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.
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
intRow += 1
after this just call your routine to pass the SQL code to the database.