Help me !!! its urgent

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2008
Posts: 126
Reputation: laghaterohan is an unknown quantity at this point 
Solved Threads: 1
laghaterohan laghaterohan is offline Offline
Junior Poster

Help me !!! its urgent

 
0
  #1
Sep 18th, 2008
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...
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 22
Reputation: isaackhazi is an unknown quantity at this point 
Solved Threads: 0
isaackhazi isaackhazi is offline Offline
Newbie Poster

Re: Help me !!! its urgent

 
0
  #2
Sep 24th, 2008
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC