Data Adapter problems on nullable columns

J

JezB

I have a dataset that I'm passing down to a data adapter which invokes
stored procedures to handle the inserts/updates/deletes. On an insert I have
some columns which are nullable, and on invoking the Insert procedure I'm
getting error

Procedure 'FlavourInsert' expects parameter '@UserID', which was not
supplied

When I have passed it to the Insert procedure as follows :

flavourAdapter.InsertCommand.Parameters.Add(new
SqlParameter("@UserID",System.Data.DbType.Int32,4,"UserID"));

How should I be passing columns to the procedure from the dataset to handle
null values ?
 
J

JezB

But hold on a minute ... I have other Insert procedures which do not
complain about null columns, so what could be causing this error? I do have
a (non-unique) index on that column in the table but I dont see why that
should affect it, anyway the error appears to be thrown from the stored
procedure call rather than the actual insert. Puzzled ...
 
J

JezB

Forget it, I was being stupid. I often find I see the solution so quickly
after posting a question here !
 

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