Dear sir,
I have basic knowledge of VB .net
I want to sum records (integer) of a column in a table if I give a specific value (text) in a field.
Dim ds As New DataSet
Dim AccessConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=p:\inquiries.mdb;")
Dim sql As String = "Select SUM(orders_amount) FROM orders WHERE (inquiries_ref = '" & TBOrdersCustomer.Text & "')"
Dim AccessCommand As New OleDbCommand(sql, AccessConn)
Dim da As New OleDbDataAdapter(AccessCommand)
da.Fill(ds)
OrdersDataGridView.DataSource = ds.Tables(0)