943,762 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 570
  • VB.NET RSS
Sep 18th, 2008
0

Help me !!! its urgent

Expand Post »
PLZ HELP ME OUT ON THIS...ITS VERY URGENT.....

Hi...plz help me out on this...i have stuck up here for past many days...
1) Plz tell me how to update the Database Table from the datagrid...
here is my code : ITS A ATTENDANCE FORM CODE...
I AM RETRIVING MY ATTENDANCE TABLE DATABASE IN THE DATAGRID...
Quote ...
Dim dbconnection As New OleDbConnection
Dim connectionstring As String = "Provider = databasename
Dim dbadapter As OleDbDataAdapter
Dim dtstudentattendance As New DataTable
Dim ds As New DataSet
dbadapter = New OleDbDataAdapter("select * from student_attendance",connectionstring)
dbadapter.Fill(dtstudentattendance)
dgstudentattendance.DataSource = dtstudentattendance
after writing this my datagrid is populated HOWEVER I AM UNABLE TO UPDATE IT...I MEAN IF I DO EDIT SOME COLUMNS HEREIN (ie. in this datagrid) like if i check or uncheck the Status columns for marking attendance and then click update the same should be updated in the database ! CAN U PLZ HELP ME OUT...

MOREOVER I DONT WANT THE ENTRIES TO REPLACE THE PREVIOUS ONES....SAY IF I MARK ATTENDANCE OF TODAY(18/SEPT) THE NEXT DAY WHEN I AGAIN POPULATE THE GRID AND MARK ATTENDANCE FOR 19/SEPT THE SAME SHOULD BE UPDATED HOWEVER 18/SEPT ENTRIES SHOULD BE INTACT...SO THAT I CAN FIGURE OUT WHO WAS PRESENT ON WHICH DAY.....Phew./////


PLZ HELP ME OUT GUYS.....AND PLZ TELL ME THE CODE ON THE ABOVE LINES ONLY.....

SECONDLY, ADAPTERNAME.UPDATE(DATASETNAME) IS NOT WORKING FOR THE PIECE OF CODE I HAVE WRITTEN ABOVE...PLZ HELP ME ITS VERY URGENT
Similar Threads
Reputation Points: 10
Solved Threads: 2
Junior Poster
laghaterohan is offline Offline
170 posts
since Aug 2008
Sep 24th, 2008
0

Re: Help me !!! its urgent

USE DataGridView and bind the grid with a datasource . first create a new datasource with the table you want to populate in the grid and then populate the grid with that datasource.....The datagridview has an option to make the datagrid editable.

No Code required just a good idea of all the features of Visual Studio.

Cheers
Reputation Points: 10
Solved Threads: 0
Newbie Poster
isaackhazi is offline Offline
22 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: listbox with two datafields
Next Thread in VB.NET Forum Timeline: How to display two fields in checkedlistbox





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC