Hello everyone
I have a problem with the connection of MS sql with the windows application problem.
All i need to do is to insert something to the database table. However i'm not sure how to connect the ms sql with it.
I have some codes written out, but i not sure if is placed in the correct order...
Please advise and help if u know how to do it correctly.
Million thanks to anyone who is kind enough to reply my post.
string sCxn = "server=myServer;Integrated Security=SSPI; database=master";
SqlConnection myConnection = new SqlConnection(sCxn );
try
{
myConnection.Open();
SqlCommand myCommand.Connection = myConnection;
myCommand.CommandText = "INSERT ....";
myCommand.ExecuteNonQuery();
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}