Click here to Skip to main content
15,885,214 members
Everything / DataContext

DataContext

DataContext

Great Reads

by Adriaan Booysen
Adding Seeding Framework towards EntityFrameworkCore that can be wired up in either a dotnet core Web Application or WebAPI
by saadishahin
A quick psedu-code for EF Core that's equivalent to modelBuilder.Configurations.AddFromAssembly in entity framework
by Shivprasad koirala
CRUD operations using LINQ Entities
by @nkit Bajpai
This article discuss a simple application built using WPF MVVM design pattern and explain the basics of Command Binding and DataBinding.

Latest Articles

by saadishahin
A quick psedu-code for EF Core that's equivalent to modelBuilder.Configurations.AddFromAssembly in entity framework
by Sherjil_Ahmed
Mixing DB-First and Code First Approach for using SPs in EF-Way
by Adriaan Booysen
Adding Seeding Framework towards EntityFrameworkCore that can be wired up in either a dotnet core Web Application or WebAPI
by @nkit Bajpai
This article discuss a simple application built using WPF MVVM design pattern and explain the basics of Command Binding and DataBinding.

All Articles

Sort by Score

DataContext 

15 Feb 2012 by Ed Nutting
Hi all,I have a Microsoft SQL Server database and I am using LINQ to SQL to interact with it in my ASP.Net C# 4.0 Website. What I would like to do is have a method that before a query is submitted to the database, grabs the command that will be sent and allows me to look at it. Basically, I...
15 Feb 2012 by Ed Nutting
Thanks greatly to amitgajjar for this solution.This solution use the in-built DataContext.Log property. Since in my situation I am running this as a website and so multiple DataContexts may exist, I used a static method to create all my DataContexts and assign to their Log property the...
2 Oct 2013 by Jegan Thiyagesan
you create a tabViewModel, in the tab view model you create the collection of user control. so each control in the collection will have its own instance and be bind to each tab. This way you will maintain the separation.App.xaml ( set the App.xaml to fire the start up event)
27 Sep 2016 by .Net Jim
Entity Framework 6 no longer supports wizard items. You are expected to use NuGet instead, then work entirely manually. Bottom line...used entity framework without the data source. Do in page load or other page event and bind to collection coming back or load collection into Datatable or...
9 May 2017 by Adriaan Booysen
Adding Seeding Framework towards EntityFrameworkCore that can be wired up in either a dotnet core Web Application or WebAPI
1 Oct 2013 by behnamse
Hi, I have 1 UserControl and im using it in several Tabs, all these tabs have same parameters but i want all parameters in different tabs save data in different places. now all parameters in tabs just can save in 1 place that i have wrote in my ViewModel on the user control. Could you please...
7 Nov 2014 by mrslyldrm
When i try to update my datacontext,i'm getting this output;Unable to generate the model because of the following exception: 'System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. --->...
7 Nov 2014 by ZurdoDev
This is not a code question but a technical issue. If you google the exact error you'll see lots of possible solutions for fixing this problem.I'd start with analyzing your query to see how you can improve it's performance.Go through the google search results and you'll see other ways...
22 Nov 2015 by Member 10842586
Hi, I am trying to add a Context Menu and bind a command to that in my tree as shown in code below. I get it, Since I am adding the Context Menu in ListBox then I will get the DataContext of List box.So here my question is How can I get the DataContext of ItemsControl while creating the...
14 Jan 2016 by Maciej Los
The easiest way is to use specific tool, such as Linqer, LinqPad, etc. See: SQL to LINQ Tool - Stack Overflow[^]On the other side, you should do - at least - minimum effort to find solution by studying 101 LINQ Samples in C#[^]
23 Sep 2016 by Member 12757084
test[,(factcols) := lapply(.SD, factor), .SDcols = factcols]factcols has a list columns for which the above needs to be applied. I am trying to understand what does .SD and .SDcols mean in the above code.Thanks in advance!!What I have tried:I am trying to understand what does .SD...
13 Jun 2018 by Gerry Schmitz
Quote: this.DataContext = cs; into this this.DataContext = new ViewModel(); but it`s doesn't work. The statements you posted are not "equivalent". Assuming the first statement even worked, your "ChartSurface" is now a "member" of the ViewModel (class); versus before when it was "at the top"....
30 Jun 2021 by Philosopheur
I have a GridView which display an image in a Grid. This App is based on PhotoLab Sample. ImageGridView_ContainerContentChanging is called when GridWiew is populated. When it's done, I would like to use RightTapped on the grid (which contains an...
2 Aug 2022 by EstKells
I have this Property: private string _TextBox1 = "Input"; public string TextBox1 { get { return _TextBox1; } set { _TextBox1 = value; ...
2 Aug 2022 by Gerry Schmitz
https://stackoverflow.com/questions/49767595/how-to-navigate-to-previous-page-in-wpf-but-keep-the-data[^]
3 Jun 2018 by saadishahin
A quick psedu-code for EF Core that's equivalent to modelBuilder.Configurations.AddFromAssembly in entity framework
11 Jul 2009 by Shivprasad koirala
CRUD operations using LINQ Entities
16 Oct 2020 by sreeyush sudhakaran
Hi, When I tried configuring the EntityDataSource of my ASP .NET 4.5 WebForms Project and Selected named connection , It Popups an Error message as below"The metadata specified in the connection string could not be loaded.Consider rebuilding the web project to built assemblies that...
13 Apr 2016 by @nkit Bajpai
This article discuss a simple application built using WPF MVVM design pattern and explain the basics of Command Binding and DataBinding.
1 Jun 2017 by Sherjil_Ahmed
Mixing DB-First and Code First Approach for using SPs in EF-Way
21 Sep 2012 by Bob Brady
In order to enable drag-drop properly between two user controls, I need to call their viewmodels from the MainWindow viewmodelI had thought that it would be as simple as this:
16 Oct 2020 by Member 14967439
1. go where you project is located(open Solution explorer. right click on solution and click on "Open Folder in file explorer" 2. open EDMX file with notepad and change ProviderManifestToken="2012" to ProviderManifestToken="2008". save it 3. ...
14 Jan 2016 by Cristo1985
Is there someone help me convert it into LINQ? SELECT DISTINCT TBCAR1.MAKE_ID, TBCAR1.Species, TBCAR1.ModelName, TBCAR1.ModelNum, TBCAR1.Body, TBCAR1.ModelFrom, TBCAR1.ModelTo, TBCAR1.Doors,TBCAR1.VersionName, TBCAR1.CodeList, TBCAR1.BodyName, TBCAR1.ModelYear, TBCAR1.Fuel, TBCAR1.Kw,...
13 Jun 2018 by Member 13251895
how correctly move this code from code behind to mvvm? namespace DemoApp { /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { ChartSurface.ChartSurface cs; double[] data; public...