Login Page in Asp.net with the backend MS-Access

Posted by Sri88ktm under ASP.NET on 11/10/2012 | Points: 10 | Views : 4194 | Status : [Member] | Replies : 1
Hi,
I am trying create Simple login page in asp. Net with backend Ms access.connected ms-access file using data connections and My db file name is "logindetails.mdb" and table is " userdetails" and mentioned in C# code.



Login.aspx.cs :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;

public partial class Login : System.Web.UI.Page
{
static OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\\logindetails.accdb") ;
OleDbDataAdapter ada = new OleDbDataAdapter();
OleDbCommand cmd = new OleDbCommand();
OleDbDataReader dr;

protected void Page_Load(object sender, EventArgs e)
{

}
protected void butsumbit_Click(object sender, EventArgs e)
{
string str;
str = "select * from userdetails where user ='"+txtuserid.text + "' and password='" + txtpwd.Text + "'";
con.Open();
cmd = new OleDbCommand(str, con);
dr = cmd.ExecuteReader();
if (dr.Read() == true)
{ Server.Transfer("menu.aspx"); }

con.Close();

}

}


error occurred while debugging :
i.e :

Error 2 'ASP.default_aspx.GetTypeHashCode()': no suitable method found to override c:\Users\Sriram\AppData\Local\Temp\Temporary ASP.NET Files\website8\be84a5ec\13f9b51f\App_Web_ovfbwxfs.0.cs 492

Error 3 'ASP.default_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\Users\Sriram\AppData\Local\Temp\Temporary ASP.NET Files\website8\be84a5ec\13f9b51f\App_Web_ovfbwxfs.0.cs 497

Error 4 'ASP.default_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\Users\Sriram\AppData\Local\Temp\Temporary ASP.NET Files\website8\be84a5ec\13f9b51f\App_Web_ovfbwxfs.0.cs 150

Error 1 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). C:\Users\Sriram\Documents\Visual Studio 2010\WebSites\WebSite8\Default.aspx.cs 11 33 C:\...\WebSite8\

Please help this issue...

Best Regards,
Sriram Muralidharan
Mail to :sri88ktm@gmail.com



Responses

Posted by: Naraayanan on: 11/11/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Please check for your class for your codebehind is named the same as your Inherits attribute, and the CodeFile points to the same.



Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Sri88ktm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response