OLEDB Select command vb.net code example

This post is about the code of OLEDB Select command.

OLEDB Select command vb.net code example

Use below code for oledb Select command

 Dim TbleAed As New DataTable 
 TbleAed.Clear() 
 ConnectOledb 
Using cmd As New OleDbCommand("select ID, TotalSale from (" & DFcashRecordsTblName & ") where ( [CountDate] Between @DateStart And @DateEnd ) order by ID", conn) 
 cmd.Parameters.Add("@DateStart", OleDbType.Date).Value = CDate(SdtCP) 
 cmd.Parameters.Add("@DateEnd", OleDbType.Date).Value = CDate(EdtCP) 
 TbleAed.Load(cmd.ExecuteReader) 
 cmdfc.Dispose()
End Using 
DisConnectOledb()

 

Leave a Comment