A
A.M
Hi,
I want to refresh my DataGrid data on every postback.
I have following code in Page_Load event, but after first page load, the
DataGrid never gets refresh.
Here is the code i have in Page_load (it works at first page_load):
Dim DS As DataSet
Dim MyConnection As System.Data.SqlClient.SqlConnection
Dim MyCommand As System.Data.SqlClient.SqlDataAdapter
MyConnection = New
System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings("ConnS
tr"))
MyCommand = New System.Data.SqlClient.SqlDataAdapter("SELECT * FROM tblLog",
MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "Log")
MyDataGrid.DataSource = DS.Tables("Log").DefaultView
MyDataGrid.DataBind()
Thanks,
Ali
I want to refresh my DataGrid data on every postback.
I have following code in Page_Load event, but after first page load, the
DataGrid never gets refresh.
Here is the code i have in Page_load (it works at first page_load):
Dim DS As DataSet
Dim MyConnection As System.Data.SqlClient.SqlConnection
Dim MyCommand As System.Data.SqlClient.SqlDataAdapter
MyConnection = New
System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings("ConnS
tr"))
MyCommand = New System.Data.SqlClient.SqlDataAdapter("SELECT * FROM tblLog",
MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "Log")
MyDataGrid.DataSource = DS.Tables("Log").DefaultView
MyDataGrid.DataBind()
Thanks,
Ali