Could have sworn I'd tried that before posting...
> can you put the full call for the param of your stored
> proc and if you clean your table put the code to I want to
> try but the error msg isn't so significant.If you can make
> a try catch to intersep the full exception call to.
> Try
> >-----Original Message-----
> >Hello all,
> >I'm having some problems with one of my forms.
> >I have a listbox (lbxcust) which is populated via a
> stored proecure /
> >datareader on form load (Form code below)
> >In the index changed event of the listbox, I'm using the
> value from the
> >listbox as an argument to another sql stored procedure
> that I'm looking at
> >using to populate a dataset.
> >The dataset is intended to be the datasource for a
> listbox (gridquote).
> >Things work fine the first time I click on the listbox,
> but the second time
> >round, I get the message:
> >#### An unhandled exception of
> type 'System.Data.SqlClient.SqlException'
> >occurred in system.data.dll
> >Additional information: System error. ####
> >This is happening on the sda.Fill(ds, "quotes")
> line within the
> >index changed event of lbxcust.
> >Am I doing something fundamentally wrong here??????
> >Many Thanks,
> >John.
> >===================================================
> >Public Class frm_recall_quote
> >Inherits System.Windows.Forms.Form
> >Private sqlcon As New SqlConnection(constring)
> >Private quotesqlcom As New SqlCommand("get_quotes")
> >Private sda As New SqlDataAdapter(quotesqlcom)
> >Private ds As New DataSet()
> >Private Sub lbxCust_SelectedIndexChanged(ByVal sender As
> System.Object,
> >ByVal e As System.EventArgs) Handles
> lbxCust.SelectedIndexChanged
> >Dim mystring As String
> >Dim myinteger As Int32
> >Dim myarg As String
> >mystring = lbxCust.Text
> >myinteger = mystring.IndexOf(" ")
> >myarg = Microsoft.VisualBasic.Left(lbxCust.Text,
> myinteger)
> >If sqlcon.State <> ConnectionState.Open Then sqlcon.Open()
> >quotesqlcom.CommandType = CommandType.StoredProcedure
> >quotesqlcom.CommandText = "get_quote"
> >quotesqlcom.Connection = sqlcon
> >sda.Fill(ds, "quotes")
> >End Sub
> >Private Sub frm_recall_quote_Load(ByVal sender As
> System.Object, ByVal e As
> >System.EventArgs) Handles MyBase.Load
> >' Open our sql connection
> >If sqlcon.State <> ConnectionState.Open Then sqlcon.Open()
> >' Lets populate our listbox
> >lbxCust.Items.Clear() ' Clear it first to avoid
> duplication
> >Dim reader As SqlDataReader
> >Dim sqlcom As New SqlCommand()
> >sqlcom.Connection = sqlcon
> >sqlcom.CommandType = CommandType.StoredProcedure
> >sqlcom.CommandText = "get_all_customers"
> >reader = sqlcom.ExecuteReader
> >With reader
> >While reader.Read = True
> >lbxCust.Items.Add(UCase(reader(0)) & " " & reader(1))
> >End While
> >End With
> >reader.Close()
> >End Sub
> >End Class
> >===================================================
> >--
> >JC
> >Funky Business
> >http://www.funky-business.co.uk
> >.