R
Raghav
Hi,
I am retrieveing the data from 2 table (MAster Detail) to the winform
and displaying on winform in a grid view.User should have an uption to
update the rows.So There is a button Update wen ever a person clicks
that DataSource needs to be updated.What i did is in Winforms for
displaying the data i have a dataset.So wenever user clicks the update
button here is what i am doing:
BindingContext[dsAdmin, "MasterMovie"].EndCurrentEdit();
BindingContext[dsAdmin, "Show"].EndCurrentEdit();
Adminshow as1 = new Adminshow();
dsAdmin2 = as1.updateData(dsAdmin);
I am passing the whole dataset to dataaccess layer.
In Data Access Layer:
public DataSet UpdateData(DataSet ds2)
{
SqlCommand cmd1 = new SqlCommand("INSERT INTO [Show]
([TheatreID], [MovieID], [Date], [NumberOfShows], [ShowTimes])" +
" VALUES (@TheatreID, @MovieID, @Date,
@NumberOfShows, @ShowTimes)", conn);
dashow1 = new SqlDataAdapter(cmd1);
SqlCommandBuilder cmb = new SqlCommandBuilder(dashow1);
DataSet ds7 = new DataSet();
ds7=ds2;
dashow1.Update(ds7, "Show");
ds7.AcceptChanges();
return ds7;
}
In BusinessLogic Layer i am just capturing this and passing it to
Winform.
But wen i close the WinForm and relod the table data again..Its still
showing the old Data not the updated one?I am not getting any error
also..
Please let me know how to go about this...
Thanks,
Raghav
I am retrieveing the data from 2 table (MAster Detail) to the winform
and displaying on winform in a grid view.User should have an uption to
update the rows.So There is a button Update wen ever a person clicks
that DataSource needs to be updated.What i did is in Winforms for
displaying the data i have a dataset.So wenever user clicks the update
button here is what i am doing:
BindingContext[dsAdmin, "MasterMovie"].EndCurrentEdit();
BindingContext[dsAdmin, "Show"].EndCurrentEdit();
Adminshow as1 = new Adminshow();
dsAdmin2 = as1.updateData(dsAdmin);
I am passing the whole dataset to dataaccess layer.
In Data Access Layer:
public DataSet UpdateData(DataSet ds2)
{
SqlCommand cmd1 = new SqlCommand("INSERT INTO [Show]
([TheatreID], [MovieID], [Date], [NumberOfShows], [ShowTimes])" +
" VALUES (@TheatreID, @MovieID, @Date,
@NumberOfShows, @ShowTimes)", conn);
dashow1 = new SqlDataAdapter(cmd1);
SqlCommandBuilder cmb = new SqlCommandBuilder(dashow1);
DataSet ds7 = new DataSet();
ds7=ds2;
dashow1.Update(ds7, "Show");
ds7.AcceptChanges();
return ds7;
}
In BusinessLogic Layer i am just capturing this and passing it to
Winform.
But wen i close the WinForm and relod the table data again..Its still
showing the old Data not the updated one?I am not getting any error
also..
Please let me know how to go about this...
Thanks,
Raghav