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

[Solved] Issue with SQLDatasource used with RadGrid

1 Answer 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff H.
Top achievements
Rank 1
Jeff H. asked on 12 Jul 2013, 06:20 PM
I am trying to configure my SQLDatasource for use with a RadGrid.  The RadGrid has a FormTemplate for use in Insert and Updates.  The database is in a SQL Server 2008 R2 server. The data selection process works fine however I am having an issue with the Insert process.  If I configure the datasource for Insert by selecting a stored procedure the setup brings in all of the Insert stored procedure parameters correctly. When I try the Insert process I receive a SQL error "System.Data.SqlClient.SqlException: Procedure or function usp_WorkPackageInsert has too many arguments specified." Even though they match exactly.  Then I tried to change the SQLDatasource to use TEXT and include the stored procedure with the @parameters in the correct order. If I try the insert process I receive an error, "Exception Details: System.Data.SqlClient.SqlException: Error converting data type decimal to decimal".  Then I tried to manually set the parameter default values in the InsertCommand subroutine and get the "too many arguments specified." error.  Then in the InsertCommand subroutine I tried to clear the Insert parameters and re-added them in the same order as they are in the stored procedure but that did not help.  Lastly I decided to try hard coding the insert in the code behind page within the "GRID1_InsertCommand" subroutine using a SQLCommand, SQLConnection, etc and the Insert works.  However, it leaves the Insert window open.

Only other issue I can think of is the data table is within a sub-schema, IE: sales.MyTable instead of dbo.Mytable.  In all cases I have tried to include the schema reference in the Insert command and it did not help.  I know the stored procedure works if I try to execute it in SSMS.

Any suggestions?  Is there a way to close the Insert window if I have to resort to the manual insert using the SQLCommand?

Thanks in Advance,  Jeff

1 Answer, 1 is accepted

Sort by
0
Jeff H.
Top achievements
Rank 1
answered on 14 Jul 2013, 05:01 PM
I was able to get this to work... Never mind... :)
Tags
Grid
Asked by
Jeff H.
Top achievements
Rank 1
Answers by
Jeff H.
Top achievements
Rank 1
Share this question
or