Updating dataset with gridview double your dating cds

I am working on a page to let a user import an excel file into our database.I want to allow the user to manipulate certain fields before committing the information so I loaded a Data Set from the Excel file and bound that to a Grid View.open visual studio – In above screen we can see, there are five column in User Mst Table in sql.The first column is ID which is identification of user, so it must be unique.For some reason on row Update my New Values collection is empty.

Create new Data Set in Data Layer Class Library project and bind select and insert stored procedure in Data Set.Well when I run my applications now I don't get any real error, but the data base is NOT being updated Please have a look at my code below and tell me what to do in order to be able to update my data base with a changed Data Set. Page { private Data Set my Data Set; private Data Table my Data Table; private EBBWS. Hi Wencui Qian Thank you for your willingness to help me I tried to put the line: my Sql Command Builder.The code behind in my cs file looks like this: public partial class Profile Info : System. EBBWeb Service my WS; string db First Name, db Last Name; string session User ID = "1"; protected void Page_Load(object sender, Event Args e) protected void save Button_Click(object sender, Event Args e) But it doesn't work I get this Error: "Data Table already belongs to this Data Set." I can understand the error, because after all what I am trying to do is to change data which already exists in the dataset. Get Update Command(); Into my DAL code, but I still get the same error: "Data Table already belongs to this Data Set." Obviously I am doing something wrong when I try to update the Data Set with the updated Data Table, my code looks like this: Hi, If your problem is with saving, why dont you loop through your datatable records and save each single row seperately. Accept Changes(); If you call this method before updating, all the row states will be updated.Add data with following code */ insert into Customer values('Gopala','Krishnan','India') Add the two class libraries with name of DAL and BLL like shown in figure and the class names also.. Dont forget to add reference of the BLL and DAL in Web Application and DAL in BLL.

Leave a Reply