WebGrid Community Server

Welcome to WebGrid Community Server Sign in | Join | Help
in Search

problem with using Stored procedure

Last post 07-30-2009, 13:45 by admin. 1 replies.
Sort Posts: Previous Next
  •  05-26-2009, 9:17 1030

    problem with using Stored procedure

    hi ,

    When i use stored procedure  to retrieve the data in the code behind page, i am not able to perform the operations such as inserting,updating or deleting the rows.
     Can any one help me in this scenario?


    I got the following errors:
    1) when i try to delete the row
    Anthem ajax error message:
    WebGrid.Design.GridException: A empty or null row identifier was passed to DeleteRow method. Make sure WebGrid has a primary key.

       at WebGrid.Data.Table.DeleteRow(String rowID)

       at WebGrid.Grid.RecordDeleteClickEvent(String[] eventArguments)

       at WebGrid.Grid.RaisePostBackEvent(String eventArgument)

       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)

       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)

       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint


    2) when i click on save and close the window

    System messageYour data source is missing primary key(s). This is needed to identify the row you want to update, insert or delete.

  •  07-30-2009, 13:45 1074 in reply to 1030

    Re: problem with using Stored procedure

    Hi,

    You need to set a column with the property PrimaryKey="true".

    Primarykeys are not automatically detected when using stored procedures or views.

    Olav Botterli, WebGrid Founding Developer

    Learn more with WebGrid Support Kit or Subscribe to WebGrid Announcements
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems