Click here to Skip to main content
14,335,049 members
   

Database

 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
Member 1028319111-Aug-18 9:14
memberMember 1028319111-Aug-18 9:14 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
Eddy Vluggen11-Aug-18 9:20
mveEddy Vluggen11-Aug-18 9:20 
AnswerRe: how to create a sum query between multiple tables in Microsoft access Pin
Mycroft Holmes11-Aug-18 13:15
memberMycroft Holmes11-Aug-18 13:15 
AnswerRe: how to create a sum query between multiple tables in Microsoft access Pin
CHill6015-Aug-18 2:15
protectorCHill6015-Aug-18 2:15 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
Mycroft Holmes15-Aug-18 13:09
memberMycroft Holmes15-Aug-18 13:09 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
CHill6020-Aug-18 4:15
protectorCHill6020-Aug-18 4:15 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
Mycroft Holmes20-Aug-18 12:57
memberMycroft Holmes20-Aug-18 12:57 
QuestionStored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1437-Aug-18 14:27
memberindian1437-Aug-18 14:27 
Hi all,

I have a stored procedure below:
ALTER PROCEDURE [dbo].[Usp_Add_ProgramType] (@Type varchar(15), @Description varchar(15), @IsValid bit
, @CreatedBy varchar(500), @ModifiedBy varchar(500))
AS
BEGIN
    if not exists(select top 1 1 from [dbo].[ProgramTypeLKP] where [Type]=@Type)
    begin
      INSERT INTO [dbo].[ProgramTypeLKP] ([Type], [Description], IsValid, CreatedDate, CreatedBy, ModifiedDate, ModifiedBy)
      values(@Type, @Description, @IsValid, getdate(), @CreatedBy, GETDATE(), @ModifiedBy)
    end
    --else
    --begin
    ----Want to return some thing here that makes EF funnction to return 0 or -1 or some value so that I can show user a message that its a duplicate record.
    --end
END
Even if the Condition fails the EF method is returning value as 1, but I want to get a value on which I will show the end user a message that he is trying to attempt to insert a duplicate record.
Like in the below script, I am checking for the result or errors, I have to get error in the response, or at least in the result some where so that I can show the user a message, I am using Kendo Grid, Create and Update with Popup (just a foot-note):
function onRequestEnd(e)
{
    //Check request type
    if (e.type == "create")
    {
        if ((e.response != null) && ((e.response.Errors != null) || (e.response.data["0"].Result <= 1)))
        {
            //Set some label value in red only when to say attempt to insert duplicate record          
        }      
    }
    else if (e.type == "update")
    {
        if ((e.response != null) && ((e.response.Errors != null) || (e.response.data["0"].Result <= 1)))
        {
            //Set some label value in red only when to say attempt to insert duplicate record          
        }        
    }
}
Can anybody please help me in this regards, thanks in advance.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."
AnswerRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
Mycroft Holmes7-Aug-18 14:37
memberMycroft Holmes7-Aug-18 14:37 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1437-Aug-18 14:39
memberindian1437-Aug-18 14:39 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
Mycroft Holmes7-Aug-18 16:38
memberMycroft Holmes7-Aug-18 16:38 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1438-Aug-18 6:38
memberindian1438-Aug-18 6:38 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
Richard Deeming8-Aug-18 0:27
mveRichard Deeming8-Aug-18 0:27 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1438-Aug-18 6:42
memberindian1438-Aug-18 6:42 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
Richard Deeming8-Aug-18 8:23
mveRichard Deeming8-Aug-18 8:23 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1439-Aug-18 6:05
memberindian1439-Aug-18 6:05 
QuestionDATABASE Maintainance Pin
ricardobrooks6-Aug-18 3:12
memberricardobrooks6-Aug-18 3:12 
AnswerRe: DATABASE Maintainance Pin
Victor Nijegorodov6-Aug-18 8:01
memberVictor Nijegorodov6-Aug-18 8:01 
AnswerRe: DATABASE Maintainance Pin
Eddy Vluggen6-Aug-18 8:15
mveEddy Vluggen6-Aug-18 8:15 
GeneralRe: DATABASE Maintainance Pin
CHill606-Aug-18 22:01
protectorCHill606-Aug-18 22:01 
Questionrecovery method for hard drive Pin
Member 139376004-Aug-18 4:08
memberMember 139376004-Aug-18 4:08 
AnswerRe: recovery method for hard drive Pin
Victor Nijegorodov4-Aug-18 20:34
memberVictor Nijegorodov4-Aug-18 20:34 
QuestionNeed to drop a schema in which there are some objects exist Pin
indian1431-Aug-18 6:28
memberindian1431-Aug-18 6:28 
AnswerRe: Need to drop a schema in which there are some objects exist Pin
Mycroft Holmes1-Aug-18 15:03
memberMycroft Holmes1-Aug-18 15:03 
AnswerRe: Need to drop a schema in which there are some objects exist Pin
CHill602-Aug-18 2:26
protectorCHill602-Aug-18 2:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.