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

[Solved] Do Stored Procedures work with RadGrid Controls?

3 Answers 215 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 15 Jul 2009, 11:02 AM
Do Stored Procedures work with the RadGrid Controls?  It appears that my Insert stored procedure has no effect on the RadGrid control and everytime I try to enter a new record, no new records get inserted.  The following is my stored procedure:

USE [EmployeeScreening]  
GO  
/****** Object:  StoredProcedure [dbo].[InsertMemberFamilyInfo]    Script Date: 07/15/2009 06:45:46 ******/  
SET ANSI_NULLS ON 
GO  
SET QUOTED_IDENTIFIER ON 
GO  
-- =============================================  
-- Author:      <user>  
-- Create date: <07/13/09>  
-- Description: <Insert Employee Family Information>  
-- =============================================  
ALTER PROCEDURE [dbo].[InsertMemberFamilyInfo]  
    -- Add the parameters for the stored procedure here   
    @MemberFamilyID             int = NULL OUTPUT,  
    @EmployeeID                 int,  
    @MemberFamilyNumber         int,  
    @Allergies                  nvarchar(50),  
    @Weight                     int,  
    @Age                        int,  
    @DateOfBirth                datetime,  
    @MemberFamilyCreatedDate    datetime,  
    @MemberFamilyCreatedBy      nvarchar(50)  
AS 
BEGIN 
 
        -- Insert statements for procedure here  
    INSERT INTO MemberFamilyInfo (EmployeeID, MemberFamilyNumber, Allergies,  
    Weight, Age, DateOfBirth, MemberFamilyCreatedDate, MemberFamilyCreatedBy) VALUES 
(@EmployeeID, @MemberFamilyNumber, @Allergies, @Weight, @Age, @DateOfBirth,  
@MemberFamilyCreatedDate, @MemberFamilyCreatedBy);  
 
SET @MemberFamilyID = SCOPE_IDENTITY();  
          
    END;  
 
DECLARE @ID INT;  
EXEC dbo.InsertMemberFamilyInfo @MemberFamilyID = @ID OUT,  
@EmployeeID = 1,  
@MemberFamilyNumber = 1,  
@Allergies='',  
@Weight=1,  
@Age = 99,  
@DateOfBirth='19000101',  
@MemberFamilyCreatedDate = '20090714',  
@MemberFamilyCreatedBy = 'Me' 
       
       
 
SELECT @ID ID; 

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 15 Jul 2009, 11:17 AM
Hello Brett,

Our controls (and RadGrid in particular) support binding and editing operations using stored procedures. You can verify that testing the sample project from the following code library thread:

http://www.telerik.com/community/code-library/submission/b311D-tgcgc.aspx

Also verify that you set the AllowAutomaticXXXX properties of the grid to true in case you do not execute the stored procedures manually intercepting the UpdateCommand/InsertCommand/DeleteCommand server grid events.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Brett
Top achievements
Rank 1
answered on 15 Jul 2009, 11:48 AM
Wow, you guys are lightning quick in responding to questions.  Is it possible to do all of the data transactions without incorporating any C# or Visual Basic back end code?  And if you have to use back end code, do you have it in Visual Basic?  Thanks!
0
Sebastian
Telerik team
answered on 15 Jul 2009, 12:41 PM
Hello Brett,

This is possible if you implement automatic data editing operations with data source controls and choose StoredProcedure commands type for the data source control as shown in the example linked previously.

In case you choose programmatic approach, you can convert C# code in VB.NET language using our free online converter.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Brett
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Brett
Top achievements
Rank 1
Share this question
or