N
Nikhil Patel
Hi,
I bind a grid to a DataView object. I lose the reference to the underlying
DataTable and the DataSet in a postback.
Here is the code. Page_Load works fine and I am able to see the rows in grid
and edit them. But I don't know how to save the data back to the database
when the user clicks on a Button. Thanks.
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
string sFieldName = Request.QueryString["FieldName"];
DataSet dataSetLookup = (DataSet) Application["Lookup"];
DataView viewLookup =
dataSetLookup.Tables["ProposalLookup"].DefaultView;
viewLookup.RowFilter = "FieldName = '"+sFieldName+"'";
viewLookup.Sort = "FieldValue";
gridLookup.DataSource = viewLookup;
gridLookup.DataBind();
}
}
I bind a grid to a DataView object. I lose the reference to the underlying
DataTable and the DataSet in a postback.
Here is the code. Page_Load works fine and I am able to see the rows in grid
and edit them. But I don't know how to save the data back to the database
when the user clicks on a Button. Thanks.
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
string sFieldName = Request.QueryString["FieldName"];
DataSet dataSetLookup = (DataSet) Application["Lookup"];
DataView viewLookup =
dataSetLookup.Tables["ProposalLookup"].DefaultView;
viewLookup.RowFilter = "FieldName = '"+sFieldName+"'";
viewLookup.Sort = "FieldValue";
gridLookup.DataSource = viewLookup;
gridLookup.DataBind();
}
}