Updating Data Using Sql Statements
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;");
MyConnection.Open();
String MyString = "UPDATE Employee SET FirstName = 'Lee'";
SqlCommand MyCmd = new SqlCommand(MyString, MyConnection);
MyCmd.ExecuteScalar();
MyConnection.Close();
}
}
|
HTML code for linking to this page:
Related in same category :
-
|