Click here to Skip to main content
16,004,927 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to save & retrieve photos in a database Pin
Vasudevan Deepak Kumar14-Mar-06 4:08
Vasudevan Deepak Kumar14-Mar-06 4:08 
AnswerRe: How to save & retrieve photos in a database Pin
Madni Abbasi14-Mar-06 5:47
Madni Abbasi14-Mar-06 5:47 
QuestionDisplaying Binary Image to PICTUREBOX Pin
thealca14-Mar-06 2:06
thealca14-Mar-06 2:06 
AnswerRe: Displaying Binary Image to PICTUREBOX Pin
thealca14-Mar-06 2:10
thealca14-Mar-06 2:10 
AnswerRe: Displaying Binary Image to PICTUREBOX Pin
albCode14-Mar-06 3:20
albCode14-Mar-06 3:20 
GeneralRe: Displaying Binary Image to PICTUREBOX Pin
Vasudevan Deepak Kumar14-Mar-06 4:09
Vasudevan Deepak Kumar14-Mar-06 4:09 
GeneralRe: Displaying Binary Image to PICTUREBOX Pin
albCode14-Mar-06 4:27
albCode14-Mar-06 4:27 
Questionnull reference, object reference not set to instance of object Pin
uglyeyes14-Mar-06 1:34
uglyeyes14-Mar-06 1:34 
i am getting above error while trying to do following.. i tried hard but dont know what went wrong,

=========
'##############
'check for existance of userID in database
Function CheckUserName(ByVal userID As String) As DataSet
objConn = New SqlConnection(dbPath)
cmd = New SqlCommand("select username from userPersonalDetails where username='" & Replace(txtUserName.Text, "'", "''") & "'", objConn)

Dim dataAdapter As SqlDataAdapter = New SqlDataAdapter
dataAdapter.SelectCommand = cmd
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)

Return dataSet
End Function

'check for existance of users email address in database
Function CheckEmail(ByVal email As String) As DataSet

objConn = New SqlConnection(dbPath)
cmd = New SqlCommand("select emailaddress from userPersonalDetails where emailaddress='" & Replace(txtEmail.Text, "'", "''") & "'", objConn)

Dim dataAdapter As SqlDataAdapter = New SqlDataAdapter
dataAdapter.SelectCommand = cmd
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)



Return dataSet
End Function

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If Page.IsValid Then

Dim userDS As New DataSet
userDS = CheckUserName(txtUserName.Text)
Dim emailDS As New DataSet
emailDS = CheckEmail(txtEmail.Text)
If userDS.Tables(0).Rows.Count = 1 Then
'userid exists so display a message
lblMsg.Text = "That UserID Exists. Please Pick Another"
ElseIf emailDS.Tables(0).Rows.Count = 1 Then
'email address exists so display a message
lblMsg.Text = "Someone has registered with that Email address."
Else
cmd = New SqlCommand("insert into userPersonalDetails values('" & Replace(txtUserName.Text, "'", "''") & _
"','" & Replace(txtPassword.Text, "'", "''") & _
"','" & Replace(txtEmail.Text, "'", "''") & _
"','" & Replace(txtFullName.Text, "'", "''") & _
"','" & Replace(txtMobPhone.Text, "'", "''") & _
"','" & Replace(txtHomePhone.Text, "'", "''") & _
"','" & Replace(txtWorkPhone.Text, "'", "''") & "',0);", objConn)

objConn.Open()
cmd.ExecuteNonQuery()
'Response.Write(cmd.CommandText)
objConn.Close()

end if
end if
end sub

many many thanks in forward
robin
AnswerRe: null reference, object reference not set to instance of object Pin
Dave Kreskowiak14-Mar-06 2:26
mveDave Kreskowiak14-Mar-06 2:26 
GeneralRe: null reference, object reference not set to instance of object Pin
uglyeyes14-Mar-06 2:44
uglyeyes14-Mar-06 2:44 
AnswerRe: null reference, object reference not set to instance of object Pin
J4amieC14-Mar-06 2:33
J4amieC14-Mar-06 2:33 
GeneralRe: null reference, object reference not set to instance of object Pin
uglyeyes14-Mar-06 18:24
uglyeyes14-Mar-06 18:24 
Questioncall Keyup probelm Pin
Jeeva Jose14-Mar-06 0:39
Jeeva Jose14-Mar-06 0:39 
AnswerRe: call Keyup probelm Pin
Chatura Dilan14-Mar-06 14:46
Chatura Dilan14-Mar-06 14:46 
Questionvb application Pin
Dralha14-Mar-06 0:30
Dralha14-Mar-06 0:30 
QuestionBeep and sound Pin
Castello0713-Mar-06 23:19
Castello0713-Mar-06 23:19 
AnswerRe: Beep and sound Pin
Vasudevan Deepak Kumar14-Mar-06 2:35
Vasudevan Deepak Kumar14-Mar-06 2:35 
GeneralRe: Beep and sound Pin
Castello0714-Mar-06 3:36
Castello0714-Mar-06 3:36 
Questioncollecting drive info service in VB.NET Pin
Daniel Loczi13-Mar-06 20:31
Daniel Loczi13-Mar-06 20:31 
AnswerRe: collecting drive info service in VB.NET Pin
albCode13-Mar-06 21:17
albCode13-Mar-06 21:17 
AnswerRe: collecting drive info service in VB.NET Pin
Vasudevan Deepak Kumar14-Mar-06 2:39
Vasudevan Deepak Kumar14-Mar-06 2:39 
QuestionRe: collecting drive info service in VB.NET Pin
Daniel Loczi17-Mar-06 21:09
Daniel Loczi17-Mar-06 21:09 
Questionnotepad application Pin
deborai13-Mar-06 20:05
deborai13-Mar-06 20:05 
AnswerRe: notepad application Pin
Vasudevan Deepak Kumar14-Mar-06 2:38
Vasudevan Deepak Kumar14-Mar-06 2:38 
Questionserch Pin
babyfam13-Mar-06 19:38
babyfam13-Mar-06 19:38 

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.