title: ASP.NET Web Application Simple Login form
body: <p>I am beginner in .Net Technology . I want to develop a web Application , Login Module with Username,Password and Button component. I have got issue on it .So plz help me to do login mod properly .</p>
  
  <p><img src="https://i.stack.imgur.com/74bXy.png" alt="Login Module Design "></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Data.SqlClient;
  using System.Data;
  using System.Configuration;
  
  
  namespace WebApplication2_loginPageTest
  {
  public partial class _Default : System.Web.UI.Page
  {
  
      protected void btnlogin_Click(object sender, EventArgs e)
      {
          SqlConnection con = new SqlConnection("DataBase=SOUMENROY-PC;Server=(local)");
          SqlDataAdapter da ;
          string mSql = " Select * from login1 where username = '" + tbusername.Text +   
   "' + and password = '" +  tbpassword.Text + "' ";
          da = new SqlDataAdapter(mSql, con);
          con.Open();
          DataSet ds = new DataSet();
          da.Fill(ds);
          if (ds.Tables[0].Rows.Count &gt; 0)
          {
              Response.Write("&lt;Script&gt; alert (uid &amp; pass taken.)&lt;/script&gt;");
          }
          else 
          {
              Response.Write("&lt;Script&gt; alert (uid &amp; pass ok.)&lt;/script&gt;");
          }
  
  
  
  
      }
   }
   }
  </code></pre>