radgrid sqldatasource stored procedure

Jan 3, 2011 at 2:03 AM

Hi there -- I'm trying to use the radgrid example, except I would like to call a stored procedure that a few parameters (PortalID, UserID, etc.). I keep getting syntax errors when I try the following -- Any ideas?

Thanks!

<mdo:asp xmlns:asp="asp" xmlns:telerik="telerik">
      <asp:SqlDataSource
          id="dsModules"
          runat="server"
          ConnectionString="&lt;%$ ConnectionStrings:SiteSqlServer %&gt;"
          SelectCommandType="StoredProcedure"                
          SelectCommand="dbo.myproc"
	<SelectParameters>
    		<asp:Parameter Name="DNNPortalID" Type="Int32" DefaultValue="0" />
 	</SelectParameters>
     />
      <telerik:RadGrid
          ID="RadGrid1"
          DataSourceID="dsModules"
          AllowPaging="True"
          PageSize="10"
          runat="server">
      </telerik:RadGrid>
</mdo:asp>

Developer
Jan 3, 2011 at 8:11 AM

Hi,

you have to close your SqlDatasource tag, here's a working sample:

 

<mdo:asp xmlns:asp="asp" xmlns:telerik="telerik">
    <asp:SqlDataSource
        id="dsModules"
        runat="server"
        ConnectionString="&lt;%$ ConnectionStrings:SiteSqlServer %&gt;"
        SelectCommandType="StoredProcedure"
        SelectCommand="GetDesktopModulesByPortal">
	<SelectParameters>
        <asp:Parameter Name="Portalid" Type="Int32" DefaultValue="{mdo:dnn('P.PortalID')}"/>
 	</SelectParameters>
    </asp:SqlDataSource>
      <telerik:RadGrid
          ID="RadGrid1"
          DataSourceID="dsModules"
          AllowPaging="True"
          PageSize="10"
          runat="server">
      </telerik:RadGrid>
</mdo:asp>