I use the following methods when I am editing data:
Dim Con as New OleDBConnection("MyStringHere")
Dim da As New OleDBDataAdapter("SELECT * FROM table",Con)
Dim ds As New DataSet
Try
Con.Open()
da.Fill(ds,"MyTable")
ds("MyTable").Rows(0)("ColumName") = Me.Jan_Revenue2.Text
ds("MyTable").Rows(1)("ColumName") = Me.Feb_Revenue2.Text
ds("MyTable").Rows(2)("ColumName") = Me.Mar_Revenue2.Text
da.UpdateCommand = New Data.OleDb.OleDbCommandBuilder(da).GetUpdateCommand
da.Update(ds.Tables("MyTable"))
Catch ex As Exception
MsgBox(ex.ToString)
Finally
Con.Close()
End Try
Begginnerdev
Practically a Posting Shark
861 posts since Apr 2010
Reputation Points: 184
Solved Threads: 141
Skill Endorsements: 8
My appologies. I had typed that code into the editor without a copy of VS handy.
Replace:
ds("MyTable").Rows(0)("ColumnName")
with
ds.Tables("MyTable").Rows(0)("ColumnName")
Begginnerdev
Practically a Posting Shark
861 posts since Apr 2010
Reputation Points: 184
Solved Threads: 141
Skill Endorsements: 8
Question Answered as of 2 Months Ago by
Begginnerdev