N
neeraj
Hi
Every body
I m not able to get dataset or datatable from datagrid.
Now I m trying this code but this is always returns nothing.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim tbl As New DataTable
Dim ds As New DataSet
Dim dr As DataRow
tbl.Columns.Add("Col1")
tbl.Columns.Add("Col2")
dr = tbl.NewRow
dr("Col1") = "Neeraj"
dr("Col2") = "Pankaj"
tbl.Rows.Add(dr)
ds.Tables.Add(tbl)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim ds As DataSet
ds = CType(DataGrid1.DataSource, DataSet)
DataGrid2.DataSource = ds
DataGrid2.DataBind()
End Sub
Command button1 working successfully but command button2 not working
I got ds = nothing when I execute command button2 code
Please help me.
Every body
I m not able to get dataset or datatable from datagrid.
Now I m trying this code but this is always returns nothing.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim tbl As New DataTable
Dim ds As New DataSet
Dim dr As DataRow
tbl.Columns.Add("Col1")
tbl.Columns.Add("Col2")
dr = tbl.NewRow
dr("Col1") = "Neeraj"
dr("Col2") = "Pankaj"
tbl.Rows.Add(dr)
ds.Tables.Add(tbl)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim ds As DataSet
ds = CType(DataGrid1.DataSource, DataSet)
DataGrid2.DataSource = ds
DataGrid2.DataBind()
End Sub
Command button1 working successfully but command button2 not working
I got ds = nothing when I execute command button2 code
Please help me.