I want the btnLogin_Click event to verify the username/password from the ms access database, if it matches it will take them to a certain page, if not it will give a message that user/password is incorrect try again. I really don't know where to start, can you please help
first I have entered the login page code, second I will enter my codebehind
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FreightBillInquiry.aspx.cs" Inherits="FBInquiry.FreightBillInquiry" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
New users can <a href="CarrierRegistration.aspx">register</a> here.<br />
<table border="0" style="border-width: 3px; border-color:#c2c2c2;
border-style: solid;">
<tr>
<td></td>
<td><strong>Please Login</strong></td></tr>
<tr>
<td>
<asp:Label ID="lblUser" runat="server" Text="Username:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtUser" runat="server"></asp:TextBox>
</td></tr>
<tr>
<td>
<asp:Label ID="lblPass" runat="server" Text="Password:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtPass" runat="server"></asp:TextBox>
</td></tr>
<tr>
<td></td>
<td>
</td></tr>
<tr>
<td></td>
<td> <asp:Button ID="btnLogin" runat="server" Text="Login"
onclick="btnLogin_Click" /></td></tr></table>
</div>
</form>
</body>
</html>
codebehind for login form
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace FBInquiry
{
public partial class FreightBillInquiry : System.Web.UI.Page
{
System.Data.OleDb.OleDbConnection con;
DataSet dsl;
System.Data.OleDb.OleDbDataAdapter da;
protected void Form1_Load(object sender, EventArgs e)
{
con = new System.Data.OleDb.OleDbConnection();
dsl = new DataSet();
con.ConnectionString = "PROVIDER=Microsoft.Jet.OleDb.4.0; Data Source=C:\\Users\\Christie\\Desktop\\login\\FBInquiry\\App_Data\\prosearchusers.mdb";
con.Open();
string sql = "SELECT * FROM tblCustRecords";
da=new System.Data.OleDb.OleDbDataAdapter(sql,con);
con.Close();
con.Dispose();
}
protected void btnLogin_Click(object sender, EventArgs e)
{
}
}
}