Hi,
We are trying to use the automatic updates, inserts etc with stored procedures. However, to many parameters sems to be sent to the procedures... Here is the markup for the grid:
<telerik:RadGrid ID="documentsGrid" DataSourceID="vegasDataSource" runat="server" | |
Skin="Office2007" AutoGenerateColumns="False" GridLines="Vertical" AllowSorting="True"> | |
<HeaderContextMenu> | |
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> | |
</HeaderContextMenu> | |
<MasterTableView CommandItemDisplay="Top" DataKeyNames="dokid,levid" DataSourceID="vegasDataSource" | |
EditMode="PopUp" AllowAutomaticInserts="True" AllowAutomaticDeletes="True" AllowAutomaticUpdates="True"> | |
<RowIndicatorColumn> | |
<HeaderStyle Width="20px"></HeaderStyle> | |
</RowIndicatorColumn> | |
<ExpandCollapseColumn> | |
<HeaderStyle Width="20px"></HeaderStyle> | |
</ExpandCollapseColumn> | |
<Columns> | |
<telerik:GridEditCommandColumn /> | |
<telerik:GridTemplateColumn DataField="levid" UniqueName="customer_id" Visible="false" | |
ReadOnly="true"> | |
</telerik:GridTemplateColumn> | |
<telerik:GridBoundColumn HeaderText="Number" UniqueName="document_id" DataField="dokid" | |
ReadOnly="true"> | |
</telerik:GridBoundColumn> | |
<telerik:GridBoundColumn HeaderText="Name" UniqueName="document_name" DataField="doknavn"> | |
</telerik:GridBoundColumn> | |
<telerik:GridBoundColumn HeaderText="Path" UniqueName="document_path" DataField="Path" | |
Visible="false"> | |
</telerik:GridBoundColumn> | |
<telerik:GridBoundColumn HeaderText="Url" UniqueName="document_url" DataField="url" | |
Visible="false"> | |
</telerik:GridBoundColumn> | |
<telerik:GridDropDownColumn HeaderText="Type" UniqueName="documen_type" ListTextField="type_description" | |
ListValueField="type_name" DataField="doktype" DataSourceID="vegasDocumentTypeDataSource"> | |
</telerik:GridDropDownColumn> | |
<telerik:GridDateTimeColumn HeaderText="Revision Date" UniqueName="column4" DataField="revisjonsdato"> | |
</telerik:GridDateTimeColumn> | |
<telerik:GridDateTimeColumn HeaderText="Edited" UniqueName="column3" DataField="document_edited" | |
ReadOnly="true"> | |
</telerik:GridDateTimeColumn> | |
<telerik:GridDateTimeColumn HeaderText="Added" UniqueName="column5" DataField="document_added" | |
ReadOnly="true"> | |
</telerik:GridDateTimeColumn> | |
<telerik:GridCheckBoxColumn HeaderText="Expired" DataField="utgaatt" UniqueName="document_expired" | |
Display="false" DataType="System.Boolean"> | |
</telerik:GridCheckBoxColumn> | |
<telerik:GridButtonColumn CommandName="Delete" Text="Delete"> | |
</telerik:GridButtonColumn> | |
</Columns> | |
<EditFormSettings> | |
<EditColumn UniqueName="EditCommandColumn1"> | |
</EditColumn> | |
</EditFormSettings> | |
</MasterTableView> | |
<ClientSettings> | |
<ClientEvents OnRowDblClick="RowDblClick" /> | |
</ClientSettings> | |
<FilterMenu> | |
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> | |
</FilterMenu> | |
</telerik:RadGrid> | |
</div> | |
</form> | |
</body> | |
</html> | |
<asp:sqldatasource runat="server" id="vegasDataSource" connectionstring="<%$ ConnectionStrings:vegas %>" | |
deletecommand="vegas.usp_DocumentationsDelete" deletecommandtype="StoredProcedure" | |
insertcommand="vegas.usp_DocumentationsInsert" insertcommandtype="StoredProcedure" | |
selectcommand="vegas.usp_DocumentationSelectReportByCustomerId" selectcommandtype="StoredProcedure" | |
updatecommand="vegas.usp_DocumentationsUpdate" updatecommandtype="StoredProcedure"> | |
<SelectParameters> | |
<asp:QueryStringParameter DefaultValue="100630" Name="customer_id" | |
QueryStringField="customerId" Type="Int32" /> | |
</SelectParameters> | |
<DeleteParameters> | |
<asp:Parameter Name="document_id" Type="String" /> | |
</DeleteParameters> | |
<UpdateParameters> | |
<asp:QueryStringParameter DefaultValue="100630" Name="customer_id" QueryStringField="customerId" Type="Int32" /> | |
<asp:Parameter Name="document_id" Type="Int32" /> | |
<asp:Parameter Name="document_name" Type="String" /> | |
<asp:Parameter Name="document_path" Type="String" /> | |
<asp:Parameter Name="documen_type" Type="String" /> | |
<asp:Parameter Name="document_url" Type="String" /> | |
<asp:Parameter Name="document_expired" Type="Boolean" /> | |
<asp:Parameter Name="document_date" Type="DateTime" /> | |
<asp:Parameter Name="document_hms" Type="String" DefaultValue="" /> | |
<asp:Parameter Name="document_msds" Type="Object" DefaultValue="" /> | |
</UpdateParameters> | |
<InsertParameters> | |
<asp:QueryStringParameter DefaultValue="100630" Name="customer_id" QueryStringField="customerId" Type="Int32" /> | |
<asp:Parameter Name="document_number" Type="String" /> | |
<asp:Parameter Name="document_name" Type="String" /> | |
<asp:Parameter Name="document_path" Type="String" /> | |
<asp:Parameter Name="documen_type" Type="String" /> | |
<asp:Parameter Name="document_url" Type="String" /> | |
<asp:Parameter Name="document_edited" Type="DateTime" /> | |
<asp:Parameter Name="document_expired" Type="Boolean" /> | |
<asp:Parameter Name="document_hms" Type="String" /> | |
<asp:Parameter Name="document_msds" Type="Object" /> | |
<asp:Parameter Direction="InputOutput" Name="document_id" Type="Int32" /> | |
</InsertParameters> | |
</asp:sqldatasource> |
As you can se he stored proc gets called with to many parameters. only the first 10 parameters is supposed to be present accouding to the the proc and the SQL data source.:
exec vegas.usp_DocumentationsUpdate | |
@customer_id=100630, | |
@document_id=NULL, | |
@document_name=NULL, | |
@document_path=NULL, | |
@documen_type=NULL, | |
@document_url=NULL, | |
@document_expired=NULL, | |
@document_date=NULL, | |
@document_hms=NULL, | |
@document_msds=NULL, | |
@doktype=N'Ã…', | |
@doknavn=N'Peva-45', | |
@url=N'http://lasso.norbye.no/weblicate/lasso/alsvag.no/resources/Brosjyre_Peva-45.pdf', | |
@Path=N'alsvaag/Brosjyre_Peva-45.pdf', | |
@revisjonsdato=N'06.03.2006 00:00:00', | |
@utgaatt=1, | |
@dokid=N'100630_002', | |
@levid=100630 |