I wanna just a beginning for my coding. (The application running with VB.NET and SQL server) I did this code and it not shown any error. After this process it is displayed the message "Successfully updated". But data is not update on the table. Please tell me, how to update the table?
This is my code....
Dim conStr As String
conStr = "Data Source=MY-PC\SQLEXPRESS;Initial Catalog=MyAccounts; Integrated Security=True"
Dim objConn As New SqlConnection(conStr)
objConn.Open()
Dim DAaccounts As New SqlDataAdapter("Select * From Accounts", objConn)
Dim DSmyAcc As New DataSet("MyAccounts")
DAaccounts.FillSchema(DSmyAcc, SchemaType.Source, "Accounts")
DAaccounts.Fill(DSmyAcc, "Accounts")
Dim tblAcc As DataTable
tblAcc = DSmyAcc.Tables("Accounts")
Dim drCurrent As DataRow
drCurrent = tblAcc.NewRow()
drCurrent("Acc_ID") = 200
drCurrent("Acc_Name") = "Test Acc"
tblAcc.Rows.Add(drCurrent)
MsgBox("Add was successful.")
objConn.Close()