Hello. I am a beginner to programming. I would like to use a form to populate my sql database. Can somebody tell me where to find information on doing this? I have my database and I'm able to display the information from from the database but I don't know how to write to it. I would like to use vb.net.
well If you know how to make a connection with the database which i think you do, because you are getting data from the db. to insert a new record is much easier.
lets say that we have a table like this Person
Dim insertStatement As String
insertStatement = "INSERT INTO Person (Name, LastName, Address) VALUES ('"+TextBox1.Text+"','"+TextBox2.Text+"','"+TextBox3.Text+"')"
Dim cmd As New System.Data.SqlClient.SqlCommand(insertStatement, Conne)
Which TextBox1.Text Contain the name or could be a string variable.
TextBox2.Text Contain the Last Name and TextBox3.Text the Address
And Conne is the connection already created.
hope that helps
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...