Hello
I am Using vb.net 2005 And sql2005
Please see then code below
In the above code there is no error but there is no affect in database
Please give me Reply
I am Using vb.net 2005 And sql2005
Please see then code below
Code:
Public Sub Saving(ByVal Table As String, ByVal Fields As String, ByVal Values As String)
Dim DsS As New DataSet
Dim cmd1 As New OleDbCommand(" Select * From " & Table & " Where 1 =2 ", Con)
'Dim cmd1 As New OleDbCommand(" Insert into Users Select * From Users Where 1=2 ", Con)
Dap = New OleDbDataAdapter(cmd1)
Dap.Fill(DsS, Table)
Dim DrS As DataRow = DsS.Tables(Table).NewRow
Dim F = Split(Fields, ",")
Dim V = Split(Values, ",")
For i As Integer = 0 To UBound(F)
DrS.Item(F(i)) = V(i)
Next
DsS.Tables(Table).Rows.Add(DrS)
DrS.AcceptChanges()
Dap.Update(DsS, Table)
DsS.AcceptChanges()
MsgBox("ADDED")
End Sub
Please give me Reply
Comment