Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 7th, 2004, 08:24 PM
Authorized User
 
Join Date: Mar 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simple Login

Hello there:D,
I just want to create a simple login that reads in a user name and password and check them against a table in MS SQL Server but using ADO.NET. The examples in the book seem to use access. I only want something basic that will display another form if the password is right and if not display an error message. Im only a beginner so any help is appreciated;)



 
Old March 8th, 2004, 03:59 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

If the examples are in Access, all you need to do is replace OleDb with SQL. So, for example:

Dim MyConnection As New OleDbConnection

becomes

Dim MyConnection As New SqlConnection

Obviously, you'll also need to change the connection string so it points to a SQL Server, not to an Access database file.
To search for the user in the database, you can use a SqlCommand that holds the SQL statement (something like SELECT FirstName, LastName FROM Users). Take a look here for details about this object.
To pass the username and password, you can use Parameter objects which you attach to the Command object, as described here.

If you search Google for SqlConnection, SqlCommand, SqlAdapter etc, you'll find loads of examples. Also, the examples in the ASP.NET SDK contain quite a lot of SQL examples.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 16th, 2004, 07:02 AM
Authorized User
 
Join Date: Mar 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks much appreciated!!!! Have working just dandy now:) Dont suspose you know anything about web services??? in the book it speaks of a XML Web Service Proxy Generator, apparently it is under tools but i cannot find it i know i can generate a proxy through the command line but dont have a clue any suggestions??






Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Login Logout Apocolypse2005 PHP Databases 1 September 25th, 2008 01:17 AM
simple Login Nuwang Forum and Wrox.com Feedback 1 June 23rd, 2008 11:36 PM
Simple login but nothing happens... Ols Beginning PHP 2 July 29th, 2006 05:04 AM
Simple ASP.NET Membership Provider Login jumpseatnews ASP.NET 2.0 Basics 0 July 16th, 2006 10:53 AM
Simple Java Login Page skchbs Java GUI 0 October 9th, 2003 06:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.