Tuesday 6 March 2012

Executing a SQL Command C#


string connectionstring = "server=MUKESH-PC\\SQLEXPRESS;database=Chat;trusted_connection=yes";

SqlConnection con = new SqlConnection(connectionstring);

con.Open();

  SqlCommand cmd = new SqlCommand("insert into login values(‘mukesh’,’friend’)", con);

cmd.ExecuteNonQuery();

con.Close();

No comments:

Post a Comment

IE7 Issues Text Indent

                 Unfortunately IE 7 is still widespread among the users hence while theming we have to give special importance to the grea...