Hi friends
i want to develop login control with asp.net ,c#, sql server 2005.
- how i check the TextBox it is validate or not by coding
- if click on button then user id & password match to textboxes and new default .aspx page should be open . i can't do next coding exccept it :-
string myConnectString = "Data Source=NBAP25169578480;Initial Catalog=employee;Integrated Security=True";
SqlConnection con = new SqlConnection(myConnectString);
SqlCommand cmd = new SqlCommand("select * from emp where userid = @userid , password = @password ",con);
cmd.CommandType =
CommandType.Text;
cmd.Connection = con;
cmd.Parameters.Add (
"@userid",TextBox1.Text );
cmd.parameter.Add("@password , TextBox2.Text"); // how i can open new page
cmd.Connection.Open();
cmd.ExecuteNonQuery();
con.Close();