What i was trying to do is to generate a list of products with all details added by user into the datagridview but as i am using datatable.load(datareader) it always reset the previous value of the datatable,i also tried datatable.load(datareader,upinsert) but same thing is happening again.
i want to insert into datatable every time when Enter is pressed along with the last result?
VB.NET:
If e.KeyCode = Keys.Return Then
cn = connectdb("MSMS.mdb", "")
Dim cmd2 As New OleDbCommand("SELECT Code,Product,Pack,Batch,Expiration,Free,MRP,Rate,CST,VAT,CD,SD FROM product WHERE Product ='" + DataGridView2.SelectedRows(0).Cells(0).Value.ToString + "'", cn)
Dim dr2 As OleDbDataReader
Dim dt As New DataTable
dr2 = cmd2.ExecuteReader()
dt.Load(dr2, LoadOption.Upsert)
DataGridView3.DataSource = dt
i want to insert into datatable every time when Enter is pressed along with the last result?