J
JohnDBCTX
Guest
I've been having too many issues with adding records, even though I established a connection.
Can anyone figure this one out?
Dim strSQL As String
strSQL = "SELECT * FROM TableOne
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DTBOne.mdb"
'connection state not open generated by error.
conn.Open()
Dim cmd As OleDbCommand = New OleDbCommand(strSQL, conn)
'create data reader
Dim rdr As OleDbDataReader = cmd.ExecuteReader
Dim ds As DataSet
ds = New DataSet
Dim row As DataRow = ds.Tables("TableOne").NewRow()
row("ID") = "1"
row("Name") = "for this one"
row("CorrespondingID") = "1"
ds.Tables("TableOne").Rows.Add(row)
conn.Close()
I just want to add records to a data grid view control if it is possible.
Regards,
JohnDBCTX
jp
Continue reading...
Can anyone figure this one out?
Dim strSQL As String
strSQL = "SELECT * FROM TableOne
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DTBOne.mdb"
'connection state not open generated by error.
conn.Open()
Dim cmd As OleDbCommand = New OleDbCommand(strSQL, conn)
'create data reader
Dim rdr As OleDbDataReader = cmd.ExecuteReader
Dim ds As DataSet
ds = New DataSet
Dim row As DataRow = ds.Tables("TableOne").NewRow()
row("ID") = "1"
row("Name") = "for this one"
row("CorrespondingID") = "1"
ds.Tables("TableOne").Rows.Add(row)
conn.Close()
I just want to add records to a data grid view control if it is possible.
Regards,
JohnDBCTX
jp
Continue reading...