User, password verification
Source code ([Link])
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtUserName" runat="server"
style="top: 16px; left: 186px; position: absolute;
height: 22px; width: 128px"></asp:TextBox>
<asp:Label ID="lblUserName" style="position:absolute;
top: 19px; left: 59px;"
runat="server" Text="User Name" Font-Bold="True"
Font-Italic="True"
Font-Size="Large" ForeColor="#FF3399"></asp:Label>
<br />
<br />
<asp:TextBox ID="txtPassword" runat="server"
style="top: 67px; left: 186px; position: absolute;
height: 22px; width: 128px"
TextMode="Password"></asp:TextBox>
<br />
<br />
<asp:Button ID="btnSubmit" runat="server"
onclick="btnSubmit_Click"
style="top: 125px; left: 195px; position: absolute;
height: 26px; width: 61px"
Text="Submit" />
<asp:Label ID="Label1" style="position:absolute; top:
122px; left: 335px;"
runat="server" Text="Label"></asp:Label>
</div>
<p>
<asp:Label ID="lblPassword" style="position:absolute;
top: 64px; left: 59px;"
runat="server" Text="Password" Font-Bold="True" Font-
Italic="True"
Font-Size="Large" ForeColor="#FF3399"></asp:Label>
</p>
</form>
</body>
</html>
[Link]
using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
public partial class _Default : [Link]
{
SqlConnection con;
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
con = new SqlConnection("Data Source=COMPUTER-
A7D401\\SQLEXPRESS;Initial Catalog=vinod;Integrated
Security=True");
[Link]();
cmd = new SqlCommand("select * from AdminUser where
UserName=@UserName and Password=@Password",con);
//[Link]("@UserName",
[Link]).Value = [Link];
//[Link]("@Password",
[Link]).Value = [Link];
[Link]("@UserName", [Link]);
[Link]("@Password", [Link]);
SqlDataReader rec;
rec = [Link]();
[Link]();
if ([Link])
{
[Link] = "successfully";
}
else
{
[Link] = "User not found";
}
}
}
Data Base