update dataset
-
i m using dataadapter to handle dataset..the date is shown in the datagrid..now i want to update the records edited by the user i have used one button to show the records,(in which i hv declared dataadapters and dataset) and behind "edit record" button i want to write the code for updation if i use the command DataAdapter.Update(Dataset); what should i do as the dataadpter and dataset are declared behind the other button?? is there any other option ( i m not using stored procedures)
$h@ma!|@
-
i m using dataadapter to handle dataset..the date is shown in the datagrid..now i want to update the records edited by the user i have used one button to show the records,(in which i hv declared dataadapters and dataset) and behind "edit record" button i want to write the code for updation if i use the command DataAdapter.Update(Dataset); what should i do as the dataadpter and dataset are declared behind the other button?? is there any other option ( i m not using stored procedures)
$h@ma!|@
$h@ma!|@ wrote:
what should i do as the dataadpter and dataset are declared behind the other button?? is there any other option
In this method you won't get
DataSet
object in Update button click since it is declared in the View button click. So what you can do is, create a new dataset from the user entered values and update that to DB. Or store the dataset in session temporarily, and in update button click modify the dataset records and callDataAdapter.Update()
method.
-
$h@ma!|@ wrote:
what should i do as the dataadpter and dataset are declared behind the other button?? is there any other option
In this method you won't get
DataSet
object in Update button click since it is declared in the View button click. So what you can do is, create a new dataset from the user entered values and update that to DB. Or store the dataset in session temporarily, and in update button click modify the dataset records and callDataAdapter.Update()
method.