Re: How to use DataReader to retrive data from the database
- From: "Mark Rae" <mark@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 21 Nov 2005 12:09:42 -0000
"Goran" <goran.sutinovski@xxxxxxxxx> wrote in message
news:1132573052.296748.213970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Private objConn As New OleDbConnection("Provider=SQLOLEDB.1;" &
Firstly, why are you using OleDb to connect to SQL Server instead of the
native .NET data provider?
> Dim objCmd As New OleDbCommand( _
> "SELECT * FROM tblEmployee" & _
> "WHERE tblEmployee.Name = @Name AND tblEmployee.Pass =
> @Pass", objConn)
Secondly, try to get into the habit of using stored procedures instead of
dynamic SQL. In this case, are "@Name" and "@Pass" VB.NET variables? If not,
I can't see how this SQL is ever going to work...
Is your DataReader object actually being populated with data?
> So from here I need the PassType so that on login I can compare the
> Name, Password and Password Type.
> I have a login.aspx page for this application. What should I write in
> it so that I can retrive the PassType information from the DataBase
> that I can after compare and eventualy to login.
Well, you could store the PassType in a Session variable; you could pass it
to the login.aspx page as a QueryString variable, or you could fetch it out
of the database in the Page_Load event of the login.aspx page.
.
- Follow-Ups:
- References:
- Prev by Date: RE: Group Authentication
- Next by Date: Re: Can I tie a validator to two controls at once?
- Previous by thread: How to use DataReader to retrive data from the database
- Next by thread: Re: How to use DataReader to retrive data from the database
- Index(es):
Relevant Pages
|