954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Datagrid

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 :)

manak chand
Newbie Poster
2 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

Edit the following code and put it in the button routine:

Dim drRow As DataRow
        Dim intRow As Integer = 0
        If DataSet1.HasChanges Then
            For Each drRow In  DataSet1.Tables("TABLENAME").Rows
                If drRow.RowState = DataRowState.Added Then
                    'add your SQL Statement for INSERT HERE
                ElseIf drRow.RowState = DataRowState.Modified Then
                    ' add your SQL Statement for UPDATE HERE
                ElseIf drRow.RowState = DataRowState.Deleted Then
                    ' add your SQL Statement for DELETE HERE
                End If
                intRow += 1
            Next

after this just call your routine to pass the SQL code to the database.

evilfruitsmashe
Newbie Poster
4 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

how to call a trigger in VB.NET from ORACLE

eminent123
Newbie Poster
1 post since Jul 2010
Reputation Points: 9
Solved Threads: 0
 

Welcome @eminent123,

Please do not resurrect old threads. If you have any questions please ask. You are welcome to start your own threads.

Thread Locked.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You