Datagrid

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

Join Date: Apr 2007
Posts: 2
Reputation: manak chand is an unknown quantity at this point 
Solved Threads: 0
manak chand manak chand is offline Offline
Newbie Poster

Datagrid

 
0
  #1
Apr 16th, 2007
Hi everyone, can anyone tell me how to store record from datagrid to oracle database at run time. user have to enter one record in datagrid at run time and the record should be saved at button click in the oracle.


manak chand
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 4
Reputation: evilfruitsmashe is an unknown quantity at this point 
Solved Threads: 0
evilfruitsmashe's Avatar
evilfruitsmashe evilfruitsmashe is offline Offline
Newbie Poster

Re: Datagrid

 
0
  #2
Apr 16th, 2007
Edit the following code and put it in the button routine:
  1. Dim drRow As DataRow
  2. Dim intRow As Integer = 0
  3. If DataSet1.HasChanges Then
  4. For Each drRow In DataSet1.Tables("TABLENAME").Rows
  5. If drRow.RowState = DataRowState.Added Then
  6. 'add your SQL Statement for INSERT HERE
  7. ElseIf drRow.RowState = DataRowState.Modified Then
  8. ' add your SQL Statement for UPDATE HERE
  9. ElseIf drRow.RowState = DataRowState.Deleted Then
  10. ' add your SQL Statement for DELETE HERE
  11. End If
  12. intRow += 1
  13. Next
after this just call your routine to pass the SQL code to the database.
Reply With Quote Quick reply to this message  
Reply

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


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