adding a record to a dataset using ado.net
I have opened a connection to an OLEDB using the following code below. However, after the application that uses the dll I created is done running and I open the access database the table does not contain the data I added. Can anyone tell me why?
' Open a connection to the database.
Dim strConnection As String = "DataSource=C:\test.mdb;"
Dim cn As oledb.oledbconnection = new oledb.oledbconnection(strConnection)
cn.Open( )
' Set up a data set command object.
Dim strSelect As String = "SELECT * FROM Table"
Dim cmd As New oledb.oledbAdapter(strSelect, cn)
Dim ds As New DataSet( )
dscmd.Fill(ds, "Table")
dim dt as datatable()
Dim row As DataRow = dt.NewRow( )
row("ID") = 1
row("Description") = "Test 1"
dt.Rows.Add(row)
' Close the connection.
cn.Close( )