Hello everyone,
I was wondering if anyone could tell me how to connect and query sql databases in ASP.NET
Using C# code
I try to use this code, but there is some mistake in the code lead to an error message
You must first withdraw from sqlDataadapter toolbar to connect to the structural language queries
using System.Data;
using System.Data.SqlClient;
{ string n1,n2,n3,n4;
n1=TextBox1.Text;
n2=TextBox2.Text;
n3=TextBox3.Text;
n4=TextBox4.Text;
Conn1.Open();
Adapter1.InsertCommand=new SqlCommand("Insert Into TEST1 Values('"+n1+"','"+n2+"','"+n3+"','"+n4+"')",Conn1);
Adapter1.InsertCommand.ExecuteNonQuery();
Conn1.Close();
}
Thank you in advance