Sunday, March 11, 2012

You tried to assign the Null value to a variable that is not a Variant data type ( problem

Your insert command should read insert into [table] ([Name]) values (?) and you should ensure that the insert parameters only includes the one for the name value.


BrianOConnell:

Your insert command should read insert into [table] ([Name]) values (?) and you should ensure that the insert parameters only includes the one for the name value.

Hi Brain, I tried the code you suggested. It worked but its inserting the value which should be for the name in the ID column and the Name column is empty !

for example : If I insert Brain in the texbox which is for the name

I don't get the error I used to get but it inserts the name to The id !

what do you think is the problem ?

This is the code which is inside the formview (if its related)

ID: <asp:Label ID="LinkIDLabel1" runat="server" Text='<%# Eval("ID") %>'></asp:Label><br />
Name: <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox><br />

Any idea ?


One more question ..

newbie^girl:

you should ensure that the insert parameters only includes the one for the name value.


How can I do that ?


Have a look at the soure of the aspx page and the sqldatasource should be there. It will have various settings and you can edit them. Inset parameters should be there somewhere. If you like post up what is there and I'll have a look.


I found the Insert parameters and deleted the one for the ID and it worked perfectly

Thank you so much

No comments:

Post a Comment