Click here to Skip to main content
15,892,746 members
Home / Discussions / Database
   

Database

 
AnswerRe: ms sql server error 18456 on sa login Pin
Richard Deeming17-Dec-19 1:33
mveRichard Deeming17-Dec-19 1:33 
QuestionSQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
Ebrahimaw21-Nov-19 19:33
Ebrahimaw21-Nov-19 19:33 
AnswerRe: SQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
Richard MacCutchan21-Nov-19 21:36
mveRichard MacCutchan21-Nov-19 21:36 
QuestionRe: SQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
ZurdoDev22-Nov-19 9:36
professionalZurdoDev22-Nov-19 9:36 
AnswerRe: SQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
Mycroft Holmes22-Nov-19 11:36
professionalMycroft Holmes22-Nov-19 11:36 
AnswerRe: SQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
Eddy Vluggen22-Nov-19 15:10
professionalEddy Vluggen22-Nov-19 15:10 
GeneralRe: SQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
Ebrahimaw25-Nov-19 16:48
Ebrahimaw25-Nov-19 16:48 
GeneralRe: SQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
Eddy Vluggen26-Nov-19 1:32
professionalEddy Vluggen26-Nov-19 1:32 
QuestionSQL Server How to add and update element in xml data in table based on match found after search using xquery Pin
Mou_kol16-Nov-19 8:20
Mou_kol16-Nov-19 8:20 
QuestionPivoting in SQL Pin
Anandkumar Prajapati12-Nov-19 23:50
professionalAnandkumar Prajapati12-Nov-19 23:50 
AnswerRe: Pivoting in SQL Pin
Richard Deeming13-Nov-19 2:17
mveRichard Deeming13-Nov-19 2:17 
GeneralRe: Pivoting in SQL Pin
#realJSOP15-Nov-19 0:18
mve#realJSOP15-Nov-19 0:18 
QuestionHow to think in MongoDB/Mongoose ?! Pin
AlexanderKolarov7-Nov-19 11:33
AlexanderKolarov7-Nov-19 11:33 
Questiondatabase ER diagrime Pin
Member 1463562026-Oct-19 4:01
Member 1463562026-Oct-19 4:01 
AnswerRe: database ER diagrime Pin
OriginalGriff26-Oct-19 4:02
mveOriginalGriff26-Oct-19 4:02 
QuestionRe: database ER diagrime Pin
Member 1463562026-Oct-19 4:14
Member 1463562026-Oct-19 4:14 
AnswerRe: database ER diagrime Pin
Richard MacCutchan26-Oct-19 4:18
mveRichard MacCutchan26-Oct-19 4:18 
AnswerRe: database ER diagrime Pin
Victor Nijegorodov26-Oct-19 5:21
Victor Nijegorodov26-Oct-19 5:21 
AnswerRe: database ER diagrime Pin
Mycroft Holmes26-Oct-19 13:05
professionalMycroft Holmes26-Oct-19 13:05 
GeneralRe: database ER diagrime Pin
Richard MacCutchan26-Oct-19 21:46
mveRichard MacCutchan26-Oct-19 21:46 
QuestionFetch data Pin
Member 1463481125-Oct-19 2:34
Member 1463481125-Oct-19 2:34 
AnswerRe: Fetch data Pin
Richard Deeming25-Oct-19 2:58
mveRichard Deeming25-Oct-19 2:58 
QuestionRe: Fetch data Pin
ZurdoDev25-Oct-19 4:22
professionalZurdoDev25-Oct-19 4:22 
Questionc# MongoDB Driver, find all products that contain a single brand name, and Group Distinct all category names, then get those categories. Pin
jkirkerx22-Oct-19 10:25
professionaljkirkerx22-Oct-19 10:25 
AnswerRe: c# MongoDB Driver, find all products that contain a single brand name, and Group Distinct all category names, then get those categories. Pin
jkirkerx22-Oct-19 10:41
professionaljkirkerx22-Oct-19 10:41 
I came up with this and it works so far. A combination of Mongo and Linq.
Changed some categoryDistinct to productDistinct, better name.
I actually didn't think it would work.
var brandTask = _context.Brands.Find(b => b.Name == brandName).FirstOrDefaultAsync();

var productsFiltered = _context.Products.Find(b => b.Brand == brandName).ToList();
var productsDistinct = productsFiltered.GroupBy(c => c.Category).Select(x => x.FirstOrDefault());
var categoriesSelected = new List<Category>();
foreach (var product in productsDistinct)
{
    var cx = _context.Categories.Find(c => c.Name == product.Category).First();
    if (cx != null)
    {
        categoriesSelected.Add(cx);
    }
}

// Use filters here for a more complex search of products
var productFilter = Builders<Product>.Filter.Eq("Brand", brandName);
var productsTask = _context.Products.Find(productFilter).ToListAsync();

await Task.WhenAll(brandTask, productsTask);

return new GetBrandPage { Brand = brandTask.Result, Categories = categoriesSelected, Products = productsTask.Result };
If it ain't broke don't fix it
Discover my world at jkirkerx.com

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.