Posted on 2004-10-21
I am using the following code, it is connected to an access database. I am lost on how to now take the connection and tie it to a textbox, then when the use adds data to the textbox having a button to update the access database. I am using a style that I have always been familiar with and would like to continue using:
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "database.mdb; Jet OLEDB:Database Password="
cmd.CommandText = "Select * from Table1"
dataadapter.selectcommand = cmd
now what should I do I tried this:
txtnames.Text = (dataset1.Tables("Table1").Rows(0).Item(dataset1.Tables("Table1").Columns(0)))
and it did put the data inside the textbox and then I just create a button that had an UPDate sql command that just looked at the textboxes and updated records. The problem is that if the field is blank(null) the programs pops up an error, also I do not know if this is the best way to do what I need it to do. So please show some code to get me what I need to complete this project I am working on.