Jump to content
Xtreme .Net Talk

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in syste


Recommended Posts

Posted (edited)

Hi, there

i'm new in VB.NET & SQL. I have a customer form in VB.NET 2003 & my table in SQL EXPRESS 2008.

 

I keep on getting this error message below at run time.

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

 

Additional information: System error.

 

The error message comes up when the line ' Dim ds As New DataSet' is being executed in the sub below. Please your help wil be kindly appreciated.

 

sub UpdateCust
Dim cstcode As Integer = CInt(Me.lblReg.Text)

       'newtstrmkstore()
       Dim query As String = "UPDATE customer SET" & _
                         " name = " & UCase(Me.txtName.Text) & _
                         " ,add1 = " & UCase(Me.txtAdd1.Text) & _
                        " ,add2 = " & UCase(Me.txtAdd2.Text) & _
                         " ,phone = " & UCase(Me.txtPhone.Text) & _
                         " ,email_id = " & UCase(Me.txtEmail.Text) & _
                         " ,fax = " & UCase(Me.txtFax.Text) & _
                         " ,title = " & UCase(Me.cboTitle.Text) & _
                         ",cust_grp = " & UCase(Me.cboCustGrp.Text) & _
                         " ,state = " & UCase(Me.TxtState.Text) & _
                        " , dor = " & ResetStr(Me.dtpCustDate.Text) & _
                        " where cust_id=" & cstcode & " "

       MsgBox("Customer has been saved successfull" & Chr(13))
  
       cn = New SqlConnection(Me.connectionstring)
       cn.Open()
      
       Dim ds As New DataSet
       Dim da As New SqlDataAdapter(query, cn)

       da.Fill(ds, "customer")
       cn.Close()
       da.Dispose()

Edited by snarfblam

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...