This is a migrated thread and some comments may be shown as answers.

[Solved] SqldataSource insert fails when field is RadNumericTextBox

1 Answer 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 14 Oct 2009, 12:21 PM
I have a Grid using automatic inserts. My Primary Key database field "USER_Pin" is an integer.  I prompt for this key using a RadNumericTextBox. However, on my INSERT I get the following error: 
Cannot insert the value NULL into column 'USER_Pin', table 'RTS.dbo.tblUsers'; column does not allow nulls. INSERT fails.The statement has been terminated.

If I change this RadNumericTextBox to a RadTextBox, the INSERT works.

I have tried changing the SqlDataSource Parameters datatypes to string, int16, even removing the type, etc..  nothing seems to work for the RadNumericTextBox

<InsertParameters>
  <asp:Parameter Name="USER_Pin" Type="Int16" />
  <asp:Parameter Name="USER_Name" Type="String" />
  <asp:Parameter Name="USER_Email" Type="String" />
  <asp:Parameter Name="USER_Override_Email" Type="String" />
  <asp:Parameter Name="USER_Privilege" Type="String" />
  <asp:Parameter Name="USER_Status" Type="String" />                
</InsertParameters>

What am I missing??

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 19 Oct 2009, 10:39 AM
Hi Robert,

Could you please confirm that you have entered any value in the RadNumericTextBox upon insert?
You can also send the grid declaration for further investigation on your case.

Greetings,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or