Page 1 of 1

Using Stored Procedure as basis for DataContext

Posted: Tue 02 Jun 2009 18:40
by GlennBA
All tables in my database are completely surrounded by sprocs.
The users have no access to the tables other than sprocs.
I know how to do Insert, Update and Delete using sprocs, but how do I do select ?

My goal is to use all the methods in DataContext for change management, etc.

I have created a Linq to SQL datacontext while I was logged into Oracle as schema owner.
This method in DataContext creates a "select xx from table" which is not allowed.
public Devart.Data.Linq.Table Kurveregs
{
get
{
return this.GetTable();
}
}
My idea is to change this method so it calls a sproc that returns a Kurvereg.
The return type here is but the return type from
the sproc is System.Data.Linq.ISingleResult

How can this be done?

Posted: Thu 04 Jun 2009 09:49
by GlennBA
Hi!

Refrasing the question

In my DataContext I have this:
public Devart.Data.Linq.Table Kurveregs
{
get
{
return this.GetTable();
}
}

Is there a way to select from a stored procedure instead ?

Posted: Thu 04 Jun 2009 11:39
by AndreyR
Such functionality is not available at the moment.
We will investigate the possibility of adding such functionality, I will let you know about the results of our investigation.

Posted: Fri 05 Jun 2009 10:49
by AndreyR
There is no possibility to override this method.
I recommend you to call the stored procedure returning the set of entites instead of writing LINQ to SQL select queries.