Note it is windows application
Data base Structure as follows in Ms Access;
Name Text
Day Text
Design as follows;
Name Combo box
Day Combo box
In the name column,all names retrieved from the database and display into the Combo box.
In the day column day from sunday to saturday is maually by coding.
in the run mode. when i select the Name and Day and click the save button. the records are saved in the database.
in the database records as follows
Suresh Sunday
Suresh Monday
i have one search button,
when i click the search button,
the above two records are displayed in the datagridview.
In the datagridview records as follows;
Name Day
Suresh Sunday
Suresh Monday
when i click the first record suresh in datagridview the particular record is display in to the combobox.
in that suppose i want to update the first record (suresh) sunday changed in to fridayand click the update button.
in the database for suresh all entries day is updated into friday.
but i want to update the friday for the first record only.
output as follows;
Suresh Friday
Suresh Friday
But i want the ouput as follows after click the update butotn(the below one is corret ouptut)
Suresh Friday
Suresh Monday
how to update.for that how can i do using csharp.
please help me.
Loading
Dorababu MekaPosted Feb 19, 2013, 3:52 AM
update table set Day="XXX" where Name="Suresh"
Try this before updating the table store day value from datagrdiview
Assuming your datagridview is as follows
Name
Day
Suresh
Firday
If you select that column or row and trying to update save your day(Friday) to a variable and update your query as follows
update table set Day='"+day+"' where Name='"+Name+"' and Day='"+string+"'