C
Curt Emich
Can someone tell me specifically what's missing in this code so that it
won't write the record into the database? Please, no references to lengthy,
bloated, meandering articles telling me how to make a watch when I'm merely
asking what time it is.
Dim thisDataAdapter As OleDb.OleDbDataAdapter = New
OleDb.OleDbDataAdapter("SELECT * FROM Sessions", OleDbConnection1)
thisDataAdapter.InsertCommand = New OleDb.OleDbCommand("INSERT INTO Sessions
SET Notes = ? ", OleDbConnection1)
thisDataAdapter.InsertCommand.Parameters.Add("Notes", OleDbType.VarChar, 15,
"Notes")
' Dim workParm As OleDbParameter =
catDA.UpdateCommand.Parameters.Add("@CategoryID", OleDbType.Integer)
' workParm.SourceColumn = "CategoryID"
' workParm.SourceVersion = DataRowVersion.Original
Dim thisDataset As DataSet = New DataSet()
thisDataAdapter.Fill(thisDataset, "Sessions")
Dim thisTable As New DataTable()
thisTable = thisDataset.Tables("Sessions")
Dim cRow As DataRow = thisTable.NewRow()
cRow("Notes") = "Yadda"
thisTable.Rows.Add(cRow)
thisDataAdapter.Update(thisDataset)
won't write the record into the database? Please, no references to lengthy,
bloated, meandering articles telling me how to make a watch when I'm merely
asking what time it is.
Dim thisDataAdapter As OleDb.OleDbDataAdapter = New
OleDb.OleDbDataAdapter("SELECT * FROM Sessions", OleDbConnection1)
thisDataAdapter.InsertCommand = New OleDb.OleDbCommand("INSERT INTO Sessions
SET Notes = ? ", OleDbConnection1)
thisDataAdapter.InsertCommand.Parameters.Add("Notes", OleDbType.VarChar, 15,
"Notes")
' Dim workParm As OleDbParameter =
catDA.UpdateCommand.Parameters.Add("@CategoryID", OleDbType.Integer)
' workParm.SourceColumn = "CategoryID"
' workParm.SourceVersion = DataRowVersion.Original
Dim thisDataset As DataSet = New DataSet()
thisDataAdapter.Fill(thisDataset, "Sessions")
Dim thisTable As New DataTable()
thisTable = thisDataset.Tables("Sessions")
Dim cRow As DataRow = thisTable.NewRow()
cRow("Notes") = "Yadda"
thisTable.Rows.Add(cRow)
thisDataAdapter.Update(thisDataset)