T
Teo
Hey guys,
I have the following code that displays DB values into a datagrid.
I want to add each of the columns in the datagrid and print the total on a
textbox I will add on the bottom.
How can I add the values that are displayed in a single column on a
datagrid?
Thanks much,
Teo
Here's the code:
Try
Dim conn2 As New MySqlConnection(strConn)
Dim strSQL2 As String
strSQL2 = "SELECT l_date as DATE, l_reg as REGISTRATION,
l_actype as TYPE, l_dep as DEPARTURE, l_arr as ARRIVAL, "
strSQL2 = strSQL2 + "l_remarks as REMARKS, l_landings as LDGS,
l_ifrapp as IFR_APP, l_seland as S_E_LAND, l_meland as M_E_LAND, l_night as
NIGHT,"
strSQL2 = strSQL2 + "l_simifr as SIM_IFR, l_actifr as ACT_IFR,
l_fsim as FSIM, l_xcountry as X_COUNTRY,"
strSQL2 = strSQL2 + "l_cfi as CFI, l_dual as DUAL_I, l_pic as
PIC, "
strSQL2 = strSQL2 + "l_total as TOTAL FROM logbook WHERE s_id =
'" + id + "' ORDER BY l_date ASC"
Dim dataadapter As New MySqlDataAdapter(strSQL2, conn2)
Dim dataset As DataSet = New DataSet
dataadapter.Fill(dataset, "Logbook")
dg.DataSource = dataset.Tables(0)
dg.ScrollBars = ScrollBars.Both
dg.AllowUserToAddRows = False
dg.AllowUserToDeleteRows = False
Any suggestions are greatly appreciated.
I have the following code that displays DB values into a datagrid.
I want to add each of the columns in the datagrid and print the total on a
textbox I will add on the bottom.
How can I add the values that are displayed in a single column on a
datagrid?
Thanks much,
Teo
Here's the code:
Try
Dim conn2 As New MySqlConnection(strConn)
Dim strSQL2 As String
strSQL2 = "SELECT l_date as DATE, l_reg as REGISTRATION,
l_actype as TYPE, l_dep as DEPARTURE, l_arr as ARRIVAL, "
strSQL2 = strSQL2 + "l_remarks as REMARKS, l_landings as LDGS,
l_ifrapp as IFR_APP, l_seland as S_E_LAND, l_meland as M_E_LAND, l_night as
NIGHT,"
strSQL2 = strSQL2 + "l_simifr as SIM_IFR, l_actifr as ACT_IFR,
l_fsim as FSIM, l_xcountry as X_COUNTRY,"
strSQL2 = strSQL2 + "l_cfi as CFI, l_dual as DUAL_I, l_pic as
PIC, "
strSQL2 = strSQL2 + "l_total as TOTAL FROM logbook WHERE s_id =
'" + id + "' ORDER BY l_date ASC"
Dim dataadapter As New MySqlDataAdapter(strSQL2, conn2)
Dim dataset As DataSet = New DataSet
dataadapter.Fill(dataset, "Logbook")
dg.DataSource = dataset.Tables(0)
dg.ScrollBars = ScrollBars.Both
dg.AllowUserToAddRows = False
dg.AllowUserToDeleteRows = False
Any suggestions are greatly appreciated.