0

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

4
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by __avd
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.

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.