Search found 4 matches

by Mojo
Fri 27 Nov 2020 08:15
Forum: Entity Framework support
Topic: View has no primary key?
Replies: 4
Views: 5903

Re: View has no primary key?

I am still struggling with this :(

The "Update From Database Wizard" does not remember the primary key I have set.

If I create a new DevArt EF class using database first, then all my views are "red" and the want me to specify a primary key. So I double click the view and specify the key.

If I in Sql server updates a view and then use "Update From Database Wizard" then the primary key is gone and the view is "Red" again. If I "Recreate model" then ALL my primary view keys are gone.

So I need to ask again ... How do I preserve all the keys I have set manual in the views when recreating the model?

Thanks.
by Mojo
Mon 14 Sep 2020 19:29
Forum: Entity Framework support
Topic: View has no primary key?
Replies: 4
Views: 5903

View has no primary key?

As I understand EF, all views must have a primary key. Though it's not possible in SQL Server View to set a primary key, so one have to do it manually in DevArt EF model. But if I recreate the model, all manual primary keys in views are lost.

I don't get it.

How do I preserve all the keys I have set manual in the views when recreating the model?
by Mojo
Tue 21 Jan 2020 10:17
Forum: LinqConnect (LINQ to SQL support)
Topic: Simple SQL returns IMultipleResults?
Replies: 4
Views: 3759

Re: Simple SQL returns IMultipleResults?

But using Microsoft LinqToSql only returns only a single set?

Your "workaround" will cause lots of headaches when recreating the model.
by Mojo
Thu 12 Dec 2019 11:51
Forum: LinqConnect (LINQ to SQL support)
Topic: Simple SQL returns IMultipleResults?
Replies: 4
Views: 3759

Simple SQL returns IMultipleResults?

Hi

I have this TSQL code...

Code: Select all

ALTER PROCEDURE [dbo].[PROC_Præmier_script_hent_perioder] 
	@gruppeID UNIQUEIDENTIFIER,
	@policetypeID UNIQUEIDENTIFIER,
	@fællespoliceID UNIQUEIDENTIFIER
AS
BEGIN
	SET NOCOUNT ON;

	
	IF @fællespoliceID IS NULL
	BEGIN
		SELECT        DISTINCT periode_fra, periode_til
		FROM          dbo.TTYP_Præmier_script
		WHERE         (slettet_dato IS NULL) AND 
					  (gruppe_ID=@gruppeID) AND 
					  (policetype_ID=@policetypeID) AND 
					  (fællespolice_ID IS NULL)
		ORDER BY	  periode_til DESC
	END
	ELSE
	BEGIN
		SELECT        DISTINCT periode_fra, periode_til
		FROM          dbo.TTYP_Præmier_script
		WHERE         (slettet_dato IS NULL) AND 
					  (fællespolice_ID=@fællespoliceID)
		ORDER BY	  periode_til DESC
	END

END
And LinqConnect returns a multiple resultsset...

Code: Select all

<FunctionAttribute(Name:="dbo.PROC_Præmier_script_hent_perioder")>
        <ResultType(GetType(PROC_Præmier_script_hent_perioderResult))>
        <ResultType(GetType(PROC_Præmier_script_hent_perioderResult1))>
        Public Function PROC_Præmier_script_hent_perioder(<Parameter(Name:="gruppeID", DbType:="UNIQUEIDENTIFIER")> gruppeID As System.Guid?, <Parameter(Name:="policetypeID", DbType:="UNIQUEIDENTIFIER")> policetypeID As System.Guid?, <Parameter(Name:="fællespoliceID", DbType:="UNIQUEIDENTIFIER")> fællespoliceID As System.Guid?) As System.Data.Linq.IMultipleResults
            Dim _PROC_Præmier_script_hent_perioderResult As IExecuteResult = Me.ExecuteMethodCall(Me, CType(MethodInfo.GetCurrentMethod(), MethodInfo), gruppeID, policetypeID, fællespoliceID)
            Return CType(_PROC_Præmier_script_hent_perioderResult.ReturnValue, System.Data.Linq.IMultipleResults)
        End Function
Why is it returning multiple resultsset?