F
foo
Hello,
My underlying data are not being updated. The rows in the dataset are
updated but when I close the app, the table (Access 2000) is unchanged. I
can read all the rows with no problem and navigate through them. The code
does not throw any errors - I had to trim it a little to put it into this
message, but this is the way it's trying to work.
dim daForm As System.Data.OleDb.OleDbDataAdapter = New
System.Data.OleDb.OleDbDataAdapter( )
dim dsForm As DataSet = New DataSet( )
dim pk(0) As DataColumn
dim myTable as string
dim mySubject as string
myTable = "tTemplate"
mySubject = "Template"
daForm.SelectCommand = New System.Data.OleDb.OleDbCommand(formSQL,
gSharedDataCon)
daForm.Fill(dsForm, myTable)
pk(0) = dsForm.Tables(myTable).Columns("TemplateID")
dsForm.Tables(myTable).PrimaryKey = pk
dsForm.Tables(myTable).Rows(0).BeginEdit()
dsForm.Tables(myTable).Rows(0)(mySubject) = "TEST"
dsForm.Tables(myTable).Rows(0).EndEdit()
dsForm.Tables(myTable).AcceptChanges()
Thanks,
Bill
Cincinnati, OH USA
My underlying data are not being updated. The rows in the dataset are
updated but when I close the app, the table (Access 2000) is unchanged. I
can read all the rows with no problem and navigate through them. The code
does not throw any errors - I had to trim it a little to put it into this
message, but this is the way it's trying to work.
dim daForm As System.Data.OleDb.OleDbDataAdapter = New
System.Data.OleDb.OleDbDataAdapter( )
dim dsForm As DataSet = New DataSet( )
dim pk(0) As DataColumn
dim myTable as string
dim mySubject as string
myTable = "tTemplate"
mySubject = "Template"
daForm.SelectCommand = New System.Data.OleDb.OleDbCommand(formSQL,
gSharedDataCon)
daForm.Fill(dsForm, myTable)
pk(0) = dsForm.Tables(myTable).Columns("TemplateID")
dsForm.Tables(myTable).PrimaryKey = pk
dsForm.Tables(myTable).Rows(0).BeginEdit()
dsForm.Tables(myTable).Rows(0)(mySubject) = "TEST"
dsForm.Tables(myTable).Rows(0).EndEdit()
dsForm.Tables(myTable).AcceptChanges()
Thanks,
Bill
Cincinnati, OH USA