
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.59 KB | hits: 8 | expires: Never
Inserting into sql server .mdf file does not work
using (SqlConnection sqlConnection = new SqlConnection(@"Data Source=.SQLE;AttachDbFilename=|DataDirectory|DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"))
{
SqlCommand sqlcommand =
new SqlCommand("INSERT INTO [Streets] ([name], [highway]) VALUES ('sdsgsdg', 'sdfdsgsdg');",
sqlConnection);
sqlcommand.Connection.Open();
MessageBox.Show(sqlcommand.ExecuteNonQuery().ToString());
sqlcommand.Connection.Close();
}