Updating datagridview in c

Rated 3.87/5 based on 964 customer reviews

Even though the picture has become a bit clearer with the extra code you have now posted, it's very difficult for us to work back from snippets of code to what the full story is likely to be. A single manager will be making Applicant to Job Title assignments. I'm using Job Titles because each Worksite may have multiple Jobs, each having multiple individual positions available.

The table Job Titles contains all the Jobs and a number of available positions for each as: tbl Job Titles(PK_Job Title IDID, FK_Job Title ID, FName, etc.) = (83838383, 123456, Bob, etc.) Now Job Title 123456 only has 4 of the original 5 positions available.

Is there any method to connect to dbase via an interface (like configure Data Source in Grdi View & other Data Controls).

Open(); Sql Data Adapter da Select = new Sql Data Adapter("SELECT * FROM Employee Table", conn); // Sql Command Builder cb Select = new Sql Command Builder(da Select); Data Set ds Select = new Data Set(); da Select.

Data Bind();//here i am getting the exception like this : A field or property with the name 'emp Id' was not found on the selected data source. I'll tell u amethod how it can be accomplished using gridview.

Write("data updated"); *** plz do reply than Q very much for the reply Sorry,this time I got another exception actually I want update one row in the database and not total fields some of the fields I want to update In mygirdview I have the information like this emp Id user Name emp Name gender address pwd loginstatus update cancel 1 kavita geeta f hjghg ghh 0 after that I clicked on the update link but now I got another exception my Grid View.

Now What I'm trying to do is when user do the changes in the grid those changes should be reflected in the list (in object properties) and then it should be updated in the database.

I just wanna update my database with one click only.

IF u r using VS 2005 or above, try to use Grid View (there are other many controls), instead of Data Grid.

What'd u actually done is that, u read data from the database & bind it again with the Datagridview.

what is the wrong here because I am not selecting individual field but its throwing this exception hmmm what to change I was out-of-mind for some time. U've to write code for updation in the Rowupdating event.

Command Text = "SELECT SUM(Total Positions) FROM Worksites WHERE key Monitor ID='" & Selected Monitor & "'" con. That is, is it essential that the app keeps going back to the database to refresh data - both ways - so that multi-users can be kept informed of changes that other users are making: or would it be possible, because only one instance of the app would be using the database at any one time, to bring everything necessary over from the database to the app at the start, make all changes in the app, and then send all changes back to the database at the end?

When updating you can call Update on both dataadapters, and no need for Update_Job Titles_Pos David Is this app operating with the database on a single-user or a multi-user basis?

Leave a Reply