Updating Data Using CommondBuilder
using System;
using System.Data;
using System.Data.SqlClient;
class MainClass
{
static void Main(string[] args)
{
SqlConnection MyConnection = new SqlConnection("server=(local)\\SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI;");
SqlDataAdapter MyDataAdapter = new SqlDataAdapter("SELECT ID, FirstName FROM Employee", MyConnection);
DataSet MyDataSet = new DataSet();
MyDataAdapter.Fill(MyDataSet);
MyDataSet.Tables[0].Rows[0][0] = 55;
SqlCommandBuilder MyCmd = new SqlCommandBuilder(MyDataAdapter);
MyDataAdapter.Update(MyDataSet);
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|