¡@

Home 

c# Programming Glossary: datacontext

Transitioning from Windows Forms to WPF

http://stackoverflow.com/questions/15681352/transitioning-from-windows-forms-to-wpf

mindset when switching from WinForms to WPF What is this DataContext you speak of A Simple MVVM Example To summarize the biggest.. Winforms and WPF is that in WPF your data layer the DataContext is your application while in Winforms your UI layer is your..

How to add a Blend Behavior in a Style Setter

http://stackoverflow.com/questions/1647815/how-to-add-a-blend-behavior-in-a-style-setter

EventName MouseLeftButtonDown local DebugAction Message DataContext 0 MessageParameter Binding local DebugAction Message ElementName.. debugTriggers Style Grid.Resources StackPanel DataContext StaticResource stringResource1 TextBlock Name textBlock1 Text..

When should I dispose of a data context

http://stackoverflow.com/questions/389822/when-should-i-dispose-of-a-data-context

save method. The code looks something like this private DataContext myDb public static MyClass GetMyClassById int id DataContext.. myDb public static MyClass GetMyClassById int id DataContext db new DataContext MyClass result from item in db.MyClasss .. static MyClass GetMyClassById int id DataContext db new DataContext MyClass result from item in db.MyClasss where item.id id select..

Binding WPF ComboBox to a Custom List

http://stackoverflow.com/questions/561166/binding-wpf-combobox-to-a-custom-list

DataTemplate applied to an ItemsControl on a Window who's DataContext has been set to a ViewModel instance. The ComboBox displays.. In the MainWindowView.xaml file code behind I set the DataContext to the MainWindowViewModel. The MainWindowView.xaml has an ItemsControl.. partial class Window1 public Window1 InitializeComponent DataContext new MainWindowViewModel Then XAML DataTemplate x Key listTemplate..

WPF DataGrid - Button in a column, getting the row from which it came on the Click event handler

http://stackoverflow.com/questions/1168976/wpf-datagrid-button-in-a-column-getting-the-row-from-which-it-came-on-the-cli

this question Basically your button will inherit the datacontext of a row data object. I am calling it as MyObject and hope MyObject.ID..

How can I write to an Excel spreadsheet using Linq?

http://stackoverflow.com/questions/1527790/how-can-i-write-to-an-excel-spreadsheet-using-linq

data rows any more . You can do that first part by calling datacontext .GetCommand yourLinqQueryHere then running that as the CommandText..

Updating an ObservableCollection in a separate thread

http://stackoverflow.com/questions/2104614/updating-an-observablecollection-in-a-separate-thread

mean if it is not the same one for taking values from LINQ datacontext and the one for giving values to update UI then I will not be..

sort columns of gridview in asp.net c#

http://stackoverflow.com/questions/213148/sort-columns-of-gridview-in-asp-net-c-sharp

gridview in c# asp.net. The databound to gridview is from datacontext created using linq. I wanted to click the header of the column..

Multiple/single instance of Linq to SQL DataContext

http://stackoverflow.com/questions/226127/multiple-single-instance-of-linq-to-sql-datacontext

questions 196253 linq to sql where does your datacontext live . You may want a slightly different strategy for each type..

Explicit construction of entity type [MyClass] in query is not allowed

http://stackoverflow.com/questions/2952856/explicit-construction-of-entity-type-myclass-in-query-is-not-allowed

I am using LINQ to SQL and have the following code in my datacontext var friends2 from f in dc.Friends where f.MyFriendsAccountId..

Ninject and DataContext disposal

http://stackoverflow.com/questions/2964673/ninject-and-datacontext-disposal

behaviour. From own experiences I know disposing the datacontext is pretty important and that whenever you create a direct object.. block Or does Ninject fix this for me c# ioc container datacontext dispose ninject share improve this question I am investigating..

Two-way binding in WPF

http://stackoverflow.com/questions/320028/two-way-binding-in-wpf

manually subscribe to the event and update the UI if your datacontext object is not the one implementing INotifyPropertyChanged. MyWindow.xaml..

Good or bad practice for Dialogs in wpf with MVVM?

http://stackoverflow.com/questions/3801681/good-or-bad-practice-for-dialogs-in-wpf-with-mvvm

IUIWindowDialogService bool ShowDialog string title object datacontext public class WpfUIWindowDialogService IUIWindowDialogService.. public bool ShowDialog string title object datacontext var win new WindowDialog win.Title title win.DataContext datacontext.. var win new WindowDialog win.Title title win.DataContext datacontext return win.ShowDialog WindowDialog is a special but simple..

Best way to update LINQ to SQL classes after database schema change

http://stackoverflow.com/questions/40022/best-way-to-update-linq-to-sql-classes-after-database-schema-change

script to start it and target the directory where your datacontext project belongs. C Program Files Microsoft SDKs Windows v6.0A..

How to do the processing and keep GUI refreshed using databinding?

http://stackoverflow.com/questions/4522583/how-to-do-the-processing-and-keep-gui-refreshed-using-databinding

class with a Model property which is your current datacontext. Change the databindings to Model.Property and add some code..

WPF MVVM Modal Overlay Dialog only over a View (not Window)

http://stackoverflow.com/questions/6351612/wpf-mvvm-modal-overlay-dialog-only-over-a-view-not-window

content grid usercontrol So here the modal dialog gets the datacontext from the DialogModel property of the Customer viewmodel and..

How to get the TSQL Query from LINQ DataContext.SubmitChanges()

http://stackoverflow.com/questions/637117/how-to-get-the-tsql-query-from-linq-datacontext-submitchanges

I find it from within the debugger c# linq linq to sql datacontext submitchanges share improve this question There is actually..

ADO.Net Entity Framework An entity object cannot be referenced by multiple instances of IEntityChangeTracker

http://stackoverflow.com/questions/694625/ado-net-entity-framework-an-entity-object-cannot-be-referenced-by-multiple-insta

Samuel Maecham have taught me that you should keep your datacontext per user per request. Which means putting it in the HttpContext..

Bind datagrid column visibility MVVM

http://stackoverflow.com/questions/7711275/bind-datagrid-column-visibility-mvvm

MVVM .Net 3.5 I know that the columns doesn't inherit the datacontext and by reading other posts i thought this would work Visibility..

Simulating Cross Context Joins--LINQ/C#

http://stackoverflow.com/questions/898363/simulating-cross-context-joins-linq-c

2 possible solutions would be to either create a single datacontext or to have 2 seperate queries which is what I'm doing for now.. select l .AsQueryable c# linq datacontext share improve this question Maybe something like this can..

Entity Framework Code First Lazy Loading

http://stackoverflow.com/questions/11469432/entity-framework-code-first-lazy-loading

set public string Name get set When i load a user using dataContext i get the list of Products being null this is ok . If i add..

yield return statement inside a using() { } block Disposes before executing

http://stackoverflow.com/questions/1539114/yield-return-statement-inside-a-using-block-disposes-before-executing

static IEnumerable Animal GetAllAnimals AnimalDataContext dataContext new AnimalDataContext return dataContext.GetAllAnimals And.. dataContext new AnimalDataContext return dataContext.GetAllAnimals And the implementation of the GetAllAnimals method.. IEnumerable Animal GetAllAnimals using AnimalDataContext dataContext new AnimalDataContext return dataContext.GetAllAnimals and..

Can you convince a DataContext to treat a column as always dirty?

http://stackoverflow.com/questions/1560513/can-you-convince-a-datacontext-to-treat-a-column-as-always-dirty

public static void MakeUpdatesDirty this DataContext dataContext params string members if dataContext null throw new ArgumentNullException.. this DataContext dataContext params string members if dataContext null throw new ArgumentNullException dataContext if members.. if dataContext null throw new ArgumentNullException dataContext if members null throw new ArgumentNullException members if members.Length..

Out of memory when creating a lot of objects C#

http://stackoverflow.com/questions/2727591/out-of-memory-when-creating-a-lot-of-objects-c-sharp

is around 2 million. IQueryable Object objectCollection dataContext.Repository Object int amountToSkip 0 IList Object objects objectCollection.Skip.. .Take 250 .ToList while objects.Count 0 using dataContext new LinqToSqlContext new DataContext foreach Object objectRecord.. item.Created DateTime.Now item.Changed DateTime.Now dataContext.InsertOnSubmit item dataContext.SubmitChanges amountToSkip..

LINQ to SQL connectionstring

http://stackoverflow.com/questions/5068944/linq-to-sql-connectionstring

ConString open connection var dataContext new MyDataContext sDBConnString this way you can change the..

Is there any benefit to implementing IDisposable on classes which do not have resources?

http://stackoverflow.com/questions/9472304/is-there-any-benefit-to-implementing-idisposable-on-classes-which-do-not-have-re

class BoxManager IBoxManager public int addBox Box b using dataContext db new dataContext db.Boxes.add b db.SaveChanges return b.id.. public int addBox Box b using dataContext db new dataContext db.Boxes.add b db.SaveChanges return b.id Will there be any..