How to solve error in ExecuteNonQuery() in asp.net
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source = (LocalDB)\MSSQLLocalDB; AttachDbFilename = C:\Users\Harry\Documents\Visual Studio 2015\WebSites\WebSite2\App_Data\Database.mdf; Integrated Security = True";
con.Open();
// insert command
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText="INSERT INTO firsttb VALUES ( @n , @p ) ";
cmd.CommandType = System.Data.CommandType.Text;
cmd.Parameters.AddWithValue("@n",TextBox1.Text);
cmd.Parameters.AddWithValue("@p", TextBox2.Text);
cmd.ExecuteNonQuery();
con.Close();
Also in C#:
- Could not load file or assembly 'Ubiety.Dns.Core, Version=2.2.1.0
- string.insert c#
- c# lambda expression
- c# anonymous class
- c# how to add newline on text box
- unity add sections to a list
- how to load the active scene unity
- split string in c#
- c# is not equal to
- unity rigidbody constraints
- unity make a int arry with preset values
- json ignore property c#
- c# max sequence contains no elements
- count the number of notes in a given amount c#
- unitt only 1 number float
- c# return multiple value unity
- c# stop loop in method
- unity prevent system from creation
- initialize matrix c#
- mongodb custom IIdGenerator
- c# sort for loop
- string to uint c#
- unity c# set gameobject active
- C# how to get public key for InternalsVisibleTo