as i mentioned, i had problem connecting to database. whenever i click run, error will occurse at my datasourcesaying(Error 1 Unrecognized escape sequence ) which is at this line
ata Source=AIZHONG-LAPTOP\SQLEXPRESS;Initial Catalog=test11;Integrated Security=True")
if i remove the \SQLexpress
another error occurred when i click the button. saying ( a network related instance. check the connection name or blablabla.)
i copy the orginal name from the database propertise which i don think is wrong. anyone is kind enough to enlighten me?
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source=AIZHONG-LAPTOP\SQLEXPRESS;Initial Catalog=test11;Integrated Security=True");
SqlCommand cmd;
SqlDataReader dr;
conn.Open();
cmd=new SqlCommand("select * from logg where name='"+ TextBox1.Text +"'and pass='"+TextBox2.Text +"'",conn);
dr= cmd.ExecuteReader();
if (dr.Read ())
{
Label3.Text="u are logged in";
}

New Topic/Question
Reply



MultiQuote




|