first chance exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

G

gv

Hi all,

I thought I would help out on a Error that comes up for a lot of people when
calling
a stored procedure from your application using sqlcommand object and
passing parameters.

this error comes up in VB.NET

"first chance exception of type 'System.Data.SqlClient.SqlException'
occurred in system.data.dll"

this took me awhile but figured it out.

Make sure in the stored procedure you declare the
variable like this for variables that might not have any data: Make it equal
nothing or null
@mainnotes TEXT = '', or @mainnotes TEXT = null

This fixed my problem, and I'm sure there are more solutions but, I hope
this helps.

The error could also come up if SQL permissions are not correct.

Gerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top