Click here to Skip to main content
15,662,737 members
Home / Discussions / Database
   

Database

 
AnswerRe: Error: Conversion failed when converting the varchar value Pin
Mycroft Holmes8-Jul-16 13:54
professionalMycroft Holmes8-Jul-16 13:54 
GeneralRe: Error: Conversion failed when converting the varchar value Pin
Richard Andrew x648-Jul-16 14:22
professionalRichard Andrew x648-Jul-16 14:22 
GeneralRe: Error: Conversion failed when converting the varchar value Pin
Mycroft Holmes8-Jul-16 21:21
professionalMycroft Holmes8-Jul-16 21:21 
GeneralRe: Error: Conversion failed when converting the varchar value Pin
Richard Andrew x649-Jul-16 4:27
professionalRichard Andrew x649-Jul-16 4:27 
GeneralRe: Error: Conversion failed when converting the varchar value Pin
Mycroft Holmes9-Jul-16 11:31
professionalMycroft Holmes9-Jul-16 11:31 
GeneralRe: Error: Conversion failed when converting the varchar value Pin
Richard MacCutchan8-Jul-16 22:50
mveRichard MacCutchan8-Jul-16 22:50 
GeneralRe: Error: Conversion failed when converting the varchar value Pin
Richard Andrew x649-Jul-16 4:28
professionalRichard Andrew x649-Jul-16 4:28 
Questionsql linq, data duplication on 1 particular record Pin
jkirkerx7-Jul-16 14:06
professionaljkirkerx7-Jul-16 14:06 
I wrote this linq statement, it worked fine until I added another join. Guess I got it wrong.
So first this i s list of departments. The first join works fine for the avatars, it's the 2nd join which is a list of categories that belong to the department.

So there are only 6 departments, but I get 11. One record, #5 gets repeated 5 times.

I can't see any errors in it unless I used the wrong join type, in which I'm not sure how to write the correct one.
pResults =
(
    from d in context.PRODUCT_DEPARTMENT
    join da1 in context.PRODUCT_DEPARTMENT_AVATARS on d.Avatar_Primary equals da1.AvatarID into avatars
    from da1 in avatars.DefaultIfEmpty()
    join pc in context.PRODUCT_CATEGORY on d.DepartmentID equals pc.DepartmentID into categories
    from pc in categories.DefaultIfEmpty()
    where d.Deleted == false
    orderby d.Name
    select new model_departments_index
    {
        DepartmentID = d.DepartmentID,
        Enabled = d.Enabled,
        Deleted = d.Deleted,
        Name = d.Name,
        Description = d.Description,
        Featured = d.Featured,
        Rollback = d.Rollback,
        Avatar_Primary_ID = d.Avatar_Primary,
        Avatar_Primary_Image = new model_type_avatar
        {
            Name = da1.Name,
            Alt = da1.Alt,
            Data = da1.Data,
            Type = da1.Type,
            Url = da1.Url
        },
        Categories =
        (
            from c in categories
            orderby c.Name
            select new json_product_categories
            {
                text = c.Name,
                value = c.CategoryID
            }
        ).ToList<json_product_categories>()
    }
).ToList();
pValue = pResults.Count();

AnswerRe: sql linq, data duplication on 1 particular record Pin
jkirkerx8-Jul-16 8:03
professionaljkirkerx8-Jul-16 8:03 
QuestionData duplication on multiple fields Pin
VK195-Jul-16 9:19
VK195-Jul-16 9:19 
AnswerRe: Data duplication on multiple fields Pin
Jörgen Andersson5-Jul-16 11:14
professionalJörgen Andersson5-Jul-16 11:14 
AnswerRe: Data duplication on multiple fields Pin
Mycroft Holmes5-Jul-16 17:21
professionalMycroft Holmes5-Jul-16 17:21 
AnswerRe: Data duplication on multiple fields Pin
jonyj18-Jul-16 2:49
jonyj18-Jul-16 2:49 
GeneralSQL Transactions - Torn apart in old code Pin
HobbyProggy5-Jul-16 1:12
professionalHobbyProggy5-Jul-16 1:12 
GeneralRe: SQL Transactions - Torn apart in old code Pin
Marc Clifton5-Jul-16 1:15
mvaMarc Clifton5-Jul-16 1:15 
GeneralRe: SQL Transactions - Torn apart in old code Pin
HobbyProggy5-Jul-16 1:18
professionalHobbyProggy5-Jul-16 1:18 
GeneralRe: SQL Transactions - Torn apart in old code Pin
Dave Kreskowiak5-Jul-16 1:51
mveDave Kreskowiak5-Jul-16 1:51 
GeneralRe: SQL Transactions - Torn apart in old code Pin
HobbyProggy5-Jul-16 1:56
professionalHobbyProggy5-Jul-16 1:56 
QuestionTime calculation Pin
AVPRF4-Jul-16 20:37
AVPRF4-Jul-16 20:37 
AnswerRe: Time calculation Pin
Mycroft Holmes4-Jul-16 21:01
professionalMycroft Holmes4-Jul-16 21:01 
GeneralRe: Time calculation Pin
AVPRF5-Jul-16 19:47
AVPRF5-Jul-16 19:47 
GeneralRe: Time calculation Pin
Mycroft Holmes6-Jul-16 12:40
professionalMycroft Holmes6-Jul-16 12:40 
GeneralRe: Time calculation Pin
AVPRF6-Jul-16 19:02
AVPRF6-Jul-16 19:02 
QuestionHow to Search for names in MySQL Pin
Jassim Rahma2-Jul-16 13:06
Jassim Rahma2-Jul-16 13:06 
AnswerRe: How to Search for names in MySQL Pin
Mycroft Holmes2-Jul-16 14:10
professionalMycroft Holmes2-Jul-16 14:10 

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.