Hi All,
I am rather new to VB.Net 05 and am a little confused about this data binding thing. I have a built in db and a form with four text boxes. I want to take the information in the text boxes and create a record, then add that record to the db. I tried the following code, but it just gets ignored. No error, no new record, nothing.
I know the code is being executed since the text boxes clear when I run it.
So my questions are:
1.) Is this approach the "right" approach? Or should I be doing this like I do with VBA/VB.Old (VB 6) and just make a data connection and execute a SQL statement.
2.) If this is a good approach, any ideas what I am missing?
P.S. I am attempting the above approach as I am trying to learn more about VB.Net. No point in learning a newer version of a language if you don't try and take avantage of it's "improvement". ;-)
Thanks for all help/feedback
I am rather new to VB.Net 05 and am a little confused about this data binding thing. I have a built in db and a form with four text boxes. I want to take the information in the text boxes and create a record, then add that record to the db. I tried the following code, but it just gets ignored. No error, no new record, nothing.
Code:
Private Sub cmdExportAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExportAdd.Click
Dim NewRecord As DataRow
NewRecord = daACRE.Tables("ExportSites").NewRow
NewRecord.Item(0) = txtExportSite.Text
NewRecord.Item(1) = txtExportTNSName.Text
NewRecord.Item(2) = txtExportUID.Text
NewRecord.Item(3) = txtExportPWD.Text
daACRE.ExportSites.Rows.Add(NewRecord)
taExportSites.Update(daACRE.ExportSites)
txtExportSite.Clear()
txtExportTNSName.Clear()
txtExportUID.Clear()
txtExportPWD.Clear()
End Sub
I know the code is being executed since the text boxes clear when I run it.
So my questions are:
1.) Is this approach the "right" approach? Or should I be doing this like I do with VBA/VB.Old (VB 6) and just make a data connection and execute a SQL statement.
2.) If this is a good approach, any ideas what I am missing?
P.S. I am attempting the above approach as I am trying to learn more about VB.Net. No point in learning a newer version of a language if you don't try and take avantage of it's "improvement". ;-)
Thanks for all help/feedback