How to check the username and password using MySql Data source in asp
<p>i am new on asp.net.<br/>
i want to know how to check my username and password by using MYSQL...<br/>
i use the following code behing my .cs file<br/></p>

<pre><code>MySqlConnection conn = new MySqlConnection("Server=localhost;Database=dbabc;Uid=root;Pwd=;");
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            conn.Open();
            Response.Write("MySQL conenct successfully");

        }
        catch (MySqlException error)
        {
            Response.Write("MySQL could not be connect to the server try agian!");
        }

    }
    protected void signin_btn_Click(object sender, EventArgs e)
    {
        int i=0;
        string sql = "SELECT username, password from login where username='" + username_tb + "' and password = '" + password_tb + "'" ;
        MySqlCommand cmd = new MySqlCommand(sql, conn);
        MySqlDataReader rdr = cmd.ExecuteReader();
        if (rdr.Read())
        {
            result.InnerText = rdr[0].ToString();
        }
        else
        {
            result.InnerText = "Sorry record Not found!";
        }


        conn.Close();
    }
</code></pre>

<p>and these are the following code in index.aspx</p>

<pre><code>Username : &lt;input type="text" id="username_tb" name="username_tb" style="weight:250px; height: 25px;" runat="server"&gt;&lt;/input&gt;&lt;br /&gt;
Password : &lt;input type="password" id="password_tb" name="password_tb" style="weight:250px; height:25px;" runat="server"&gt;&lt;/input&gt;&lt;br /&gt;
&lt;input type="submit" name="submit" value="Signin" style="weight:30px; height:25px; margin-top: 3px;" runat="server" onserverclick="signin_btn_Click"&gt;&lt;/input&gt;&lt;br /&gt;

&lt;/div&gt;
&lt;label id="result" runat="server"&gt;&lt;/label&gt;
</code></pre>

<p>so finally i need to say that i want a result which says username and password are correct in case of sucess and username and password was not correct in case of failure </p>
