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

ASP.NET

 
AnswerRe: Restricting access to pages inside a folder Pin
Not Active15-Jun-07 1:59
mentorNot Active15-Jun-07 1:59 
Questionabout datatable Pin
lockepeak14-Jun-07 16:30
lockepeak14-Jun-07 16:30 
AnswerRe: about datatable Pin
Christian Graus14-Jun-07 17:57
protectorChristian Graus14-Jun-07 17:57 
AnswerRe: about datatable Pin
_AK_14-Jun-07 22:02
_AK_14-Jun-07 22:02 
Questionasp.net using crystal report Pin
moomoooomoo14-Jun-07 14:54
moomoooomoo14-Jun-07 14:54 
AnswerRe: asp.net using crystal report Pin
Sathesh Sakthivel14-Jun-07 15:06
Sathesh Sakthivel14-Jun-07 15:06 
QuestionPage has expired issue. [modified] Pin
terife14-Jun-07 13:37
terife14-Jun-07 13:37 
QuestionObject reference not set to an instance of an objec [modified] Pin
ASPnoob14-Jun-07 13:20
ASPnoob14-Jun-07 13:20 
Hi, I have made changes to my code according to the responses I was getting the last time I post a question about the exception " Object reference not set to an instance of an object". I still get the same exception after the changes. It's saying that the line

strGoodPassword = CType(myCommand.ExecuteScalar, String)

is the cause of the problem. I don't know what else to to, please take a look at my code below. Thank you in advance for your help.

Private Sub lblRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblRegister.Click
        Dim bResult As Boolean = False
        Dim myConnection As OdbcConnection
        Dim myCommand As OdbcCommand
        Dim strInsert As String
        Dim strGoodPassword As String
        Dim strSQL As String
        strSQL = String.Empty
        
        myConnection = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=myDb;User=myUSERassword=myPW;Option=3;")
        strSQL = String.Format("SELECT myUserName FROM myTable WHERE (email='{0}');", txtUserName.text)
        myConnection.Open()
        strGoodPassword = CType(myCommand.ExecuteScalar, String)
        If Not strGoodPassword Is Nothing Then
            If strGoodPassword = txtUserName.Text Then
                bResult = True
            Else
                lblMessage.Text = "That user name is already taken!"
                lblMessage.Text &= "  Please choose another user name."
            End If
        Else
            lblMessage.Text = "That user name is already taken!"
            lblMessage.Text &= "  Please choose another user name."
        End If
        strInsert = "INSERT into membersinfotbl (FirstName,LastName,Password,Phone,Email,Profession,StrAddress,City,State,ZipCode)value (?,?,?,?,?,?,?,?,?,?)"
        
        myCommand As New OdbcCommand(strInsert,myConnection)
        myCommand.Parameters.Add("@FirstName", txtFirst.Text)
        myCommand.Parameters.Add("@LastName", txtLast.Text)
        myCommand.Parameters.Add("@Password", txtPassword.Text)
        myCommand.Parameters.Add("@Phone", txtPhone.Text)
        myCommand.Parameters.Add("@Email", txtEmail.Text)
        myCommand.Parameters.Add("@Profession", txtProfession.Text)
        myCommand.Parameters.Add("@StrAddress", txtAddress.Text)
        myCommand.Parameters.Add("@City", txtCity.Text)
        myCommand.Parameters.Add("@State", txtState.Text)
        myCommand.Parameters.Add("@ZipCode", txtZipCode.Text)        
        myCommand.ExecuteNonQuery()
        myConnection.Close()
End Sub



-- modified at 20:03 Thursday 14th June, 2007
AnswerRe: Object reference not set to an instance of an objec Pin
Christian Graus14-Jun-07 13:56
protectorChristian Graus14-Jun-07 13:56 
GeneralRe: Object reference not set to an instance of an objec Pin
ASPnoob14-Jun-07 14:09
ASPnoob14-Jun-07 14:09 
GeneralRe: Object reference not set to an instance of an objec Pin
Not Active14-Jun-07 14:36
mentorNot Active14-Jun-07 14:36 
GeneralRe: Object reference not set to an instance of an objec [modified] Pin
ASPnoob14-Jun-07 18:13
ASPnoob14-Jun-07 18:13 
AnswerRe: Object reference not set to an instance of an objec Pin
Chetan Ranpariya14-Jun-07 21:08
Chetan Ranpariya14-Jun-07 21:08 
AnswerRe: Object reference not set to an instance of an objec Pin
ShuklaGirish14-Jun-07 20:42
ShuklaGirish14-Jun-07 20:42 
AnswerRe: Object reference not set to an instance of an objec Pin
ShuklaGirish14-Jun-07 20:58
ShuklaGirish14-Jun-07 20:58 
GeneralRe: Object reference not set to an instance of an objec Pin
ASPnoob14-Jun-07 21:54
ASPnoob14-Jun-07 21:54 
Question[Message Deleted] Pin
basi001414-Jun-07 11:57
basi001414-Jun-07 11:57 
AnswerRe: Urgent Help Needed: How to display data returned from MS Access? Pin
Not Active14-Jun-07 12:06
mentorNot Active14-Jun-07 12:06 
AnswerRe: How to display data returned from MS Access? Pin
Christian Graus14-Jun-07 13:57
protectorChristian Graus14-Jun-07 13:57 
GeneralRe: How to display data returned from MS Access? Pin
Christian Graus14-Jun-07 18:01
protectorChristian Graus14-Jun-07 18:01 
QuestionSend an email Pin
seemamltn14-Jun-07 10:57
seemamltn14-Jun-07 10:57 
AnswerRe: Send an email Pin
Not Active14-Jun-07 12:01
mentorNot Active14-Jun-07 12:01 
AnswerRe: Send an email Pin
RepliCrux14-Jun-07 19:26
RepliCrux14-Jun-07 19:26 
QuestionPopulating a control with data bound in a GridView Pin
Chris McGlothen14-Jun-07 10:22
Chris McGlothen14-Jun-07 10:22 
QuestionData Grid --> Data Key Field Pin
wongeva14-Jun-07 7:20
wongeva14-Jun-07 7:20 

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.