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

ASP.NET

 
QuestionObject reference not set to an instance of an objec [modified] Pin
ASPnoob14-Jun-07 13:20
ASPnoob14-Jun-07 13:20 
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 
I think there is error in ur insert query,
it is Insert into table_name(columns) <b>values</b>
u have written value,this might be the proble.



If that doesnt wotks try the code given below,
Still if it is not working send me reply.


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)
myCommand =new OdbcCommand("SELECT myUserName FROM myTable WHERE email='" & 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("INSERT into membersinfotbl (FirstName,LastName,Password,Phone,Email,Profession,StrAddress,City,State,ZipCode) values ('" & txtFirst.Text & "','" & txtLast.Text & "','" & txtPassword.Text & "','" & txtPhone.Text & "','" & txtEmail.Text & "','" & txtProfession.Text & "','" & txtAddress.Text & "','" & txtCity.Text & "','" & txtState.Text & "','" & txtZipCode.Text & "')",myConnection)


myConnection.Close()
End Sub


GIRISH
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 
AnswerRe: Data Grid --> Data Key Field Pin
Chetan Ranpariya14-Jun-07 21:18
Chetan Ranpariya14-Jun-07 21:18 
QuestionHelp please !! TemplateColumn in Datagrid Pin
papy-boom14-Jun-07 6:33
papy-boom14-Jun-07 6:33 
AnswerRe: Help please !! TemplateColumn in Datagrid Pin
Sathesh Sakthivel14-Jun-07 6:36
Sathesh Sakthivel14-Jun-07 6:36 
QuestionHelp with Setting up a data entry form on SQL serv Pin
theimmortalmoo14-Jun-07 6:11
theimmortalmoo14-Jun-07 6:11 
AnswerRe: Help with Setting up a data entry form on SQL serv Pin
Sathesh Sakthivel14-Jun-07 6:14
Sathesh Sakthivel14-Jun-07 6:14 
GeneralRe: Help with Setting up a data entry form on SQL serv Pin
theimmortalmoo14-Jun-07 6:23
theimmortalmoo14-Jun-07 6:23 
GeneralRe: Help with Setting up a data entry form on SQL serv Pin
Sathesh Sakthivel14-Jun-07 6:26
Sathesh Sakthivel14-Jun-07 6:26 

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.