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

CRUD on related tables in Grid

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 06 Feb 2015, 06:04 PM
I have two tables that are related. Is it possible to do Automatic CRUD operations that populate and update both tables?
I tried to create a view that joins both tables and entered that view into my model but I get an error:  Additional information: Invalid object name 'voa_keygen'. Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'voa_keygen'. ---> System.Data.SqlClient.SqlException: Invalid object name 'voa_keygen'.

Below are my two tables:

CREATE TABLE [dbo].[Security_Role_To_Webpage](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [webpage_name] [varchar](200) NULL,
    [security_role_id] [int] NULL,
    [add_privledge] [bit] NULL,
    [edit_privledge] [bit] NULL,
    [delete_privledge] [bit] NULL,
    [view_privledge] [bit] NULL,
 CONSTRAINT [PK_security_role_to_webpage] PRIMARY KEY CLUSTERED
(
    [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
 
GO
 
SET ANSI_PADDING OFF
GO
 
ALTER TABLE [dbo].[Security_Role_To_Webpage] ADD  CONSTRAINT [DF_Security_Role_To_Webpage_add_privledge]  DEFAULT ((0)) FOR [add_privledge]
GO
 
ALTER TABLE [dbo].[Security_Role_To_Webpage] ADD  CONSTRAINT [DF_Security_Role_To_Webpage_edit_privledge]  DEFAULT ((0)) FOR [edit_privledge]
GO
 
ALTER TABLE [dbo].[Security_Role_To_Webpage] ADD  CONSTRAINT [DF_Security_Role_To_Webpage_delete_privledge]  DEFAULT ((0)) FOR [delete_privledge]
GO
 
ALTER TABLE [dbo].[Security_Role_To_Webpage] ADD  CONSTRAINT [DF_Security_Role_To_Webpage_view_privledge]  DEFAULT ((0)) FOR [view_privledge]
GO
 
ALTER TABLE [dbo].[Security_Role_To_Webpage]  WITH CHECK ADD  CONSTRAINT [FK__security___secur__60A75C0F] FOREIGN KEY([security_role_id])
REFERENCES [dbo].[Security_Role] ([ID])
GO
 
ALTER TABLE [dbo].[Security_Role_To_Webpage] CHECK CONSTRAINT [FK__security___secur__60A75C0F]
GO


CREATE TABLE [dbo].[Security_Role](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Role] [varchar](100) NULL,
 CONSTRAINT [PK_security_role] PRIMARY KEY CLUSTERED
(
    [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
 
GO
 
SET ANSI_PADDING OFF
GO


When trying to update or add to two related tables in the radgrid is this a case where you HAVE to use manual CRUD operations?

Thanks!

1 Answer, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 06 Feb 2015, 06:18 PM
I got past this error by finding the solution on your website. I set the ID field in the view within my model to identity in the properties window.

I think what I am looking to do overall though I will need to go to manual CRUD operations.
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Share this question
or