Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

conversion from string

I have implemented a stored procedure that implements a search, that should work. However, I have this code in the Search button, that is meant to send any combination of these 4 parametres. However, it's giving me an error

"conversion from string "" to type 'integer' is not valid"

I'm sure it's a stupid mistake of mine, but I cant seem to find the problem and hence the solution.

Private Sub Search_Patient_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search_Patient.Click

Dim ID_No, Name, Surname As String
Dim Patient_No As Integer

ID_No = ""
Patient_No = 0
Name = ""
Surname = ""

ID_No = ID_No_TextBox.text
Patient_No = (CType(Patient_No_TextBox.Text, Integer))
Name = Name_TextBox.Text
Surname = Surname_TextBox.Text

Try
Me.PatientTableAdapter.FillBy(Me.DatabaseDataSet.Patient, ID_No, Patient_No, Name, Surname)
MessageBox.Show("Retrieving Patient Data Complete")
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
MessageBox.Show("Error retrieving Patient Data")
End Try
End Sub

Can anyone please help? Thanks
[1389 byte] By [claudecalleja] at [2007-11-11 8:34:42]
# 1 Re: conversion from string
solved!! I just had a mismatch with the stored procedure
claudecalleja at 2007-11-11 21:47:14 >