Hi,
This is the code sample that I am using for displaying records in a datagrid.
sql = "select r.srno 'SNo.',r.gcno 'Gas Connection No.',c.kno 'KNO',r.areacode 'Area Code',c.houseno 'House no.',c.consname 'Name',c.address1 'Address',r.rcptno 'Receipt No.',r.receiptdt 'Receipt Date',r.totrcptamt 'Amount' from tbl_allmastran c,tbl_receipts r where(c.gcno = r.gcno) and r.receiptdt between '" & Format(FromDate.Value, "MM/dd/yyyy") & "' and '" & Format(ToDate.Value, "MM/dd/yyyy") & "'" & _
"union select r.srno 'SNo.',r.gcno 'Gas Connection No.',c.kno 'KNO',r.areacode 'Area Code',c.houseno 'House no.',c.consname 'Name',c.address1 'Address',r.rcptno 'Receipt No.',r.receiptdt 'Receipt Date',r.totrcptamt 'Amount' from tbl_newcon c,tbl_receipts r where(c.gcno = r.gcno) and r.receiptdt between '" & Format(FromDate.Value, "MM/dd/yyyy") & "' and '" & Format(ToDate.Value, "MM/dd/yyyy") & "' order by r.receiptdt,r.gcno,r.rcptno,r.srno"
Dim adapter As New OleDb.OleDbDataAdapter(sql, myconnection)
Dim arcptdataset As New DataSet()
Dim tsl As New DataGridTableStyle()
Dim checkcol As New DataGridBoolColumn()
Try
adapter.Fill(arcptdataset, "receipts")
adapter.Dispose()
Dgriddetails.CaptionText = arcptdataset.Tables("receipts").Rows.Count & " " & "Record(s) found"
Dgriddetails.SetDataBinding(arcptdataset, "receipts")
tsl.MappingName = "receipts"
checkcol.HeaderText = "Checked"
checkcol.MappingName = ""
checkcol.Width = 50
tsl.GridColumnStyles.Add(checkcol)
Dgriddetails.TableStyles.Add(tsl)
Catch
Dgriddetails.CaptionText = "No records present"
End Try
The above code gives me a blank datagrid with the captiontext showing me the number of records.
what should be given in the checkcol.mappingname property, as I want to only create a column of checkboxes.
Can any one out there help me. Thanx in advance. I am using .NET 1.1 (2003).
Regards
Vinodi
~~The only place where SUCCESS comes before WORK is in the dictionary~~
This is the code sample that I am using for displaying records in a datagrid.
sql = "select r.srno 'SNo.',r.gcno 'Gas Connection No.',c.kno 'KNO',r.areacode 'Area Code',c.houseno 'House no.',c.consname 'Name',c.address1 'Address',r.rcptno 'Receipt No.',r.receiptdt 'Receipt Date',r.totrcptamt 'Amount' from tbl_allmastran c,tbl_receipts r where(c.gcno = r.gcno) and r.receiptdt between '" & Format(FromDate.Value, "MM/dd/yyyy") & "' and '" & Format(ToDate.Value, "MM/dd/yyyy") & "'" & _
"union select r.srno 'SNo.',r.gcno 'Gas Connection No.',c.kno 'KNO',r.areacode 'Area Code',c.houseno 'House no.',c.consname 'Name',c.address1 'Address',r.rcptno 'Receipt No.',r.receiptdt 'Receipt Date',r.totrcptamt 'Amount' from tbl_newcon c,tbl_receipts r where(c.gcno = r.gcno) and r.receiptdt between '" & Format(FromDate.Value, "MM/dd/yyyy") & "' and '" & Format(ToDate.Value, "MM/dd/yyyy") & "' order by r.receiptdt,r.gcno,r.rcptno,r.srno"
Dim adapter As New OleDb.OleDbDataAdapter(sql, myconnection)
Dim arcptdataset As New DataSet()
Dim tsl As New DataGridTableStyle()
Dim checkcol As New DataGridBoolColumn()
Try
adapter.Fill(arcptdataset, "receipts")
adapter.Dispose()
Dgriddetails.CaptionText = arcptdataset.Tables("receipts").Rows.Count & " " & "Record(s) found"
Dgriddetails.SetDataBinding(arcptdataset, "receipts")
tsl.MappingName = "receipts"
checkcol.HeaderText = "Checked"
checkcol.MappingName = ""
checkcol.Width = 50
tsl.GridColumnStyles.Add(checkcol)
Dgriddetails.TableStyles.Add(tsl)
Catch
Dgriddetails.CaptionText = "No records present"
End Try
The above code gives me a blank datagrid with the captiontext showing me the number of records.
what should be given in the checkcol.mappingname property, as I want to only create a column of checkboxes.
Can any one out there help me. Thanx in advance. I am using .NET 1.1 (2003).
Regards
Vinodi
~~The only place where SUCCESS comes before WORK is in the dictionary~~