Skip to content

Instantly share code, notes, and snippets.

@tedliou
Created November 15, 2015 07:10
Show Gist options
  • Save tedliou/8dc0885c67763235323d to your computer and use it in GitHub Desktop.
Save tedliou/8dc0885c67763235323d to your computer and use it in GitHub Desktop.
string cmdsql = "INSERT INTO [dbo].[ttt] ([yn], [gn], [an], [sc], [am]) VALUES (11, 12, 13, 14, 15)";
SqlConnection sql = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\bin\Debug\liusql.mdf;Integrated Security=True;Connect Timeout=30");
SqlCommand cmd = new SqlCommand(cmdsql, sql);
sql.Open();
cmd.ExecuteNonQuery();
sql.Close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment