Click here to Skip to main content
15,898,743 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: What web service am I conneccted to? Pin
WillemM17-Jun-07 5:31
WillemM17-Jun-07 5:31 
AnswerRe: What web service am I conneccted to? Pin
Saifi Hasan17-Jun-07 18:45
Saifi Hasan17-Jun-07 18:45 
QuestionPrinting Datagrid with multiple pages on single button click Pin
Vipin.d16-Jun-07 21:06
Vipin.d16-Jun-07 21:06 
AnswerRe: Printing Datagrid with multiple pages on single button click Pin
WillemM17-Jun-07 5:30
WillemM17-Jun-07 5:30 
GeneralRe: Printing Datagrid with multiple pages on single button click Pin
Vipin.d17-Jun-07 19:17
Vipin.d17-Jun-07 19:17 
QuestionString.Format Pin
ASPnoob16-Jun-07 20:59
ASPnoob16-Jun-07 20:59 
AnswerRe: String.Format Pin
Arun.Immanuel16-Jun-07 21:22
Arun.Immanuel16-Jun-07 21:22 
GeneralRe: String.Format Pin
ASPnoob16-Jun-07 22:19
ASPnoob16-Jun-07 22:19 
The reason I was confused was because txtUserName.text is used for inputing a user's user name. The following was the code that I found for validating a user's Login.
Function DBAuthenticate(ByVal strUsername As String, ByVal strPassword As String) As Integer
       Dim bResult As Boolean = False
       Dim objConn As New OleDbConnection(ConfigurationSettings.AppSettings("myDB"))
       Dim strSQL As String
       Dim strGoodPassword As String
       Dim objCommand As New OleDbCommand

       objCommand.Connection = objConn
       strSQL = String.Format("SELECT p_w FROM myDB WHERE (email='{0}');", txtUserName.text)
       objCommand.CommandText = strSQL
       objCommand.CommandType = CommandType.Text

       objConn.Open()
       strGoodPassword = CType(objCommand.ExecuteScalar, String)
       objConn.Close()

       If Not strGoodPassword Is Nothing Then
           If strGoodPassword = strPassword Then
               bResult = True
           Else
               lblMessage.Text = "Invalid Login!"
               lblMessage.Text &= "  If you are not a member please click the above link to register."
           End If
       Else
           lblMessage.Text = "Invalid Login!"
           lblMessage.Text &= "  If you are not a member please click the above link to register."
       End If

       Return bResult
   End Function


Could you please explain the role of strSQL in this code? I am confused as to why it was used like that. Thank you in advance for your help.
GeneralRe: String.Format Pin
PandemoniumPasha16-Jun-07 22:58
PandemoniumPasha16-Jun-07 22:58 
GeneralRe: String.Format Pin
Dave Sexton16-Jun-07 23:10
Dave Sexton16-Jun-07 23:10 
QuestionAccess denied to a file IIS Pin
kallileo16-Jun-07 18:25
kallileo16-Jun-07 18:25 
AnswerRe: Access denied to a file IIS Pin
Expert Coming16-Jun-07 20:38
Expert Coming16-Jun-07 20:38 
AnswerRe: Access denied to a file IIS Pin
vikasparth16-Jun-07 22:07
vikasparth16-Jun-07 22:07 
GeneralRe: Access denied to a file IIS Pin
kallileo17-Jun-07 21:57
kallileo17-Jun-07 21:57 
QuestionKeyPress Event in ASP.NET C#? Pin
railesh16-Jun-07 2:16
railesh16-Jun-07 2:16 
AnswerRe: KeyPress Event in ASP.NET C#? Pin
Expert Coming16-Jun-07 4:48
Expert Coming16-Jun-07 4:48 
AnswerRe: KeyPress Event in ASP.NET C#? Pin
www.Developerof.NET16-Jun-07 7:08
www.Developerof.NET16-Jun-07 7:08 
AnswerRe: KeyPress Event in ASP.NET C#? Pin
Not Active16-Jun-07 13:26
mentorNot Active16-Jun-07 13:26 
QuestionExecuting more than one query Pin
Tarik Guney16-Jun-07 0:34
Tarik Guney16-Jun-07 0:34 
AnswerRe: Executing more than one query Pin
Expert Coming16-Jun-07 1:16
Expert Coming16-Jun-07 1:16 
AnswerRe: Executing more than one query Pin
Dave Sexton16-Jun-07 2:01
Dave Sexton16-Jun-07 2:01 
AnswerRe: Executing more than one query Pin
Arun.Immanuel16-Jun-07 2:11
Arun.Immanuel16-Jun-07 2:11 
GeneralRe: Executing more than one query Pin
Tarik Guney16-Jun-07 7:21
Tarik Guney16-Jun-07 7:21 
QuestionDifference b/e Onlnit(), OnPreInit() and LoadViewState()/ LoadPostBackData() Pin
vikasviswan15-Jun-07 21:41
vikasviswan15-Jun-07 21:41 
AnswerRe: Difference b/e Onlnit(), OnPreInit() and LoadViewState()/ LoadPostBackData() Pin
Christian Graus15-Jun-07 22:04
protectorChristian Graus15-Jun-07 22:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.