Sunday, January 11, 2009

using Inserting Data Using SQLStatements tutorial example

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 = @"INSERT INTO Employee(ID, FirstName, LastName) VALUES(2, 'G', 'M')";
SqlCommand MyCmd = new SqlCommand(MyString, MyConnection);

MyCmd.ExecuteScalar();
MyConnection.Close();
}
}

0 comments:

Followers

The Daily Puppy

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | JCPenney Coupons