471,348 Members | 1,288 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Upadate Database from datgrid in 3-tier archi

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
Jun 27 '08 #1
0 887

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Cherrish Vaidiyan | last post: by
8 posts views Thread by Kamlesh | last post: by
1 post views Thread by pintur | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.