How to connect my ASP.NET using c# with Microsoft sql server 2000?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ernest joel
    New Member
    • Feb 2011
    • 2

    How to connect my ASP.NET using c# with Microsoft sql server 2000?

    When i click this button connection should establish ...
    my coding is
    Code:
     protected void Button1_Click(object sender, EventArgs e)
        {
            cn.Open();
            cmd.Connection = cn;
             
                cmd.CommandText = "select user,pass from register where user_id='" & TextBox1.Text & "' and password='" & TextBox2.Text & "'";
                s = cmd.ExecuteReader();
                If s.Read(); Then
                    Response.redirect("Login.aspx");
                Else
                    Response.Write("invalid username or password");
                End If
            
            cn.Close();
        
    }
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    So, what is your question?

    Comment

    • ernest joel
      New Member
      • Feb 2011
      • 2

      #3
      was my coding correct if so what i have to do next .. if my coding is wrong where i have to change my coding

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Well, does it work?

        Comment

        Working...