|
|
|
|
|
|
|
Author Rank :
|
|
|
Page Views :
|
3356
|
|
Downloads :
|
0
|
|
Rating :
|
Rate it
|
|
Level :
|
Intermediate
|
|
Hi,
Till now we had done the Programming using SQL Server and XML as databases. Truely speaking, I never thought of using MS Access till two days back when I got a mail asking for this. So here is something with Access. In this Example the authetication unit is there from Access Database.
Just make a simple Table having three Coloumns UserName,Password and Info .Here you will asking user for username and password and if authenticated provide him with the info field.
Check out the Code
Source Code:
//AccessData.aspx <mobile:Form runat="server" ID="Form1"> <mobile:Label id="WelcomeMessage" runat="server"> </mobile:Label> </mobile:Form> <%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" Language="C#"Debug="true" %> <%@ Register TagPrefix="mobile"Namespace="System.Web.UI.MobileControls"Assembly="System.Web.Mobile" % <%@ Import Namespace="System" %> <%@ Import Namespace="System.Data"%> <%@ Import Namespace="System.Data.OleDb" %> <script runat="server" language="C#"> public String str; public string strAccessConn ="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=E:Shivani/Shivani.mdb "; DataSet myDataSet = new DataSet(); int RowCount; public void Check_Login(Object sender, EventArgs e) { if(Page.IsValid) { OleDbConnection myAccessConn = new OleDbConnection(strAccessConn); OleDbCommand myAccessCommand = new OleDbCommand("select info from mytable where UserName ='"+Login.Text +"'and Password ='"+Password.Text+"'",myAccessConn); OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(myAccessCommand); myAccessConn.Open(); try { myDataAdapter.Fill(myDataSet,"mytable"); } finally { myAccessConn.Close(); } RowCount = myDataSet.Tables["mytable"].Rows.Count ; DataRowCollection dra = myDataSet.Tables["mytable"].Rows ; foreach (DataRow dr in dra) { str = dr[0].ToString(); } if (RowCount == 0) { ActiveForm = Form3; } else { ConfirmLogin.Text = "your current Balance is $"+str; ActiveForm =Form2; } } </script> <mobile:Form id = "Form1" runat="server"> <mobile:Label runat="server" ID="Label1">Login</mobile:Label> <mobile:TextBox runat="server" id="Login" /> <mobile:Label runat="server" ID="Label2">Password</mobile:Label> <mobile:TextBox runat="server" id="Password" Password="True"/> <mobile:Command runat="server" OnClick="Check_Login" Text="Go!" ID="Command1"/> </mobile:Form> <mobile:Form runat="server" id="Form2"> <mobile:Label id ="ConfirmLogin" runat="server" /> </mobile:Form> <mobile:Form runat="server" id="Form3"> <mobile:Label id ="Fails" runat="server" >Authentication Failed </mobile:Label> <mobile:Link runat="server" NavigateURL="#Form1" ID="Link1">Try Again</mobile:Link> </mobile:Form>
Here you can access Coloumn,get the Count of Rows,Coloumns ,No of Tables in a DataBase and many more things you can do.Let me explore this name space some More and very soon let make a design play with this also. Till then Have Fun.
|
|
Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post
Here.
|
|
|
|
|
Login
to add your contents and source code to this article
|
|
|
|
|
|
|
|
|
|
|
|
Shivani
Shivani is Electronics graduate from REC Bhopal, INDIA. After Electronics she jumped to software development and has been dealing with WAP and Java technologies. Currently she is working with C# and ASP.NET for a transaction Portal.
|
|
|
|
|
|
|
|
|
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional
consulting company, our consultants are well-known experts in .NET and many of them
are MVPs, authors, and trainers. We specialize in Microsoft .NET development and
utilize Agile Development and Extreme Programming practices to provide fast pace
quick turnaround results. Our software development model is a mix of Agile Development,
traditional SDLC, and Waterfall models.
|
|
Click here to learn more about C# Consulting. |
|
|
|
|
|
|
|
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon.
Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees.
As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
|
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
|
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
|
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
|
|
|
|
|
|
|
|
|
|
|
|
|