Say I have a L2S Update and I would like to display what changed to the user. Where does GetChangeSet() get populated? Immediately after I assign values or after context.SubmitChanges()?
If the second; I could, theoretically, change the return type to IList and then return return context.GetChangeSet().Updates;?
...
I have some code that looks like this:
<Expander Header="{Binding SelectedSlot.Name}"
Visibility="{Binding ShowGroupSlot, Converter={StaticResource BooleanToVisibility}}">
<Controls:GroupPrototypeSlotControl Slot="{Binding DataContext.SelectedSlot,
RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x...
Similar error as other questions, but not quite the same, I am not trying to attach anything.
What I am trying to do is insert a new row into a linking table, specifically UserAccomplishment. Relations are set in LINQ to User and Accomplishment Tables.
I have a generic insert function:
Public Function insertRow(ByVal entity As Impleme...
Should each save/update method in a LINQ-to-SQL repository be wrapped in a new data context?
Consider the SavePage method in my partial SqlPageRepository:
public class SqlPageRepository : IPageRepository
{
private DB _db;
public SqlPageRepository(DB db) // I use IoC
{
_db = db;
}
public IQueryable<Page> Ge...
I'm trying to do the following thing:
I have a TabControl with several tabs.
Each TabControlItem.Content points to PersonDetails which is a UserControl
Each BookDetails has a dependency property called IsEditMode
I want a control outside of the TabControl , named ToggleEditButton, to be updated whenever the selected tab changes.
I tho...
I have some scenarios where I need to have multiple calls to .SubmitChanges() on a datacontext, but I want to explicitly control the transaction myself to make it atomic. For a while I have been doing this by creating a connection, creating a transaction on that connection, then creating the datacontext and passing it both. Lets assume f...
Hello,
I speak about josh smith article.
can anyone show me please how the CustomerView.xaml specifically this:j
<TextBox
x:Name="firstNameTxt"
Grid.Row="2" Grid.Column="2"
Text="{Binding Path=FirstName, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
Validation.ErrorTemplate="{x:Null}"
/>
Why is ther...
I am creating an mssql database table, "Orders", that will contain a varchar(50) field, "Value" containing a string that represents a slightly complex data type, "OrderValue".
I am using a linqtosql datacontext class, which automatically types the "Value" column as a string.
I gave the "OrderValue" class implicit conversion operators t...
Hello,
I am integrating SqlCacheDependency to use in my LinqToSQL datacontext.
I am using an extension class for Linq querys found here - http://code.msdn.microsoft.com/linqtosqlcache
I have wired up the code and when I open the page I get this exception -
"The SQL Server Service Broker for the current database is not enabled, and a...
Hello,
I have a UserControl with 5 small UserControl which are parts of the first UserControl.
The first UserControl is datatemplated by a MainViewModel type.
The other 5 small UserControls have also set the DataContext to this MainViewModel type.
Now I want additionally that those 5 UserControls get a 2nd DataContext to access other...
This whole question is for WPF C#.
I have a class that has an event procedure that can fire at any time. The event procedure contains some text data that I need to display in a listbox. What is the best practice for making sure that the DataContext of the listbox is updated accurately as the event procedure fires?
...
In .NET 4 and multicore environment, does the linq to sql datacontext object take advantage of the new parallels if we use DataLoadOptions.LoadWith?
EDIT
I know linq to sql does not parallelize ordinary queries. What I want to know is when we specify DataLoadOption.LoadWith, does it use parallelization to perform the match between each...
Hi,
I'm working on a WPF application which must handle multiple screens (two at this this time).
One view can be opened on several screens and user actions must be reflected consistently on all screens.
To achieve this, for a given type of view, a single DataContext is instantiated. Then, when a view is displayed on a screen, the uniq...
Hi,
I'm developing a Silverlight 4 app and am using the 2010 Q1 release 1 RadGridView. I'm developing this app using the MVVM pattern and trying to keep my codebehind to a minimum.
On my View I have a RadGridView and this binds to a property on my ViewModel. I am setting a property via the SelectedItem. I have a nested RadGridView a...
For some reason my DataContext is not showing all the normal methods like SubmitChanges() etc in the intellisense.
It also won't compile if I type in db.SubmitChanges();
Any idea what I'm doing wrong? Normally I don't have this issue, I have several other projects that work fine...
Image of what I'm talking about:
...
(honestly I searched and read all the 'related questions' that seemed relevant - i do hope i didn't "miss" this question from elsewhere but here goes...)
There are two different ways (at least) to set the DataContext. One can use XAML or one can use the code behind.
What is the 'best practice' and why?
I tend to favor setting it in X...
I'm having a problem with LINQ.
I have 2 tables (Parent-child relation)
Table1: Events (EventID, Description)
Table2: Groups (GroupID, EventID(FK), Description)
Now i want to create an Event an and a child.
Event e = new Event();
e.Description = "test";
Datacontext.Events.InsertOnSubmit(event)
Group g = new Group();
g.Description =...
With a DataContext and a blank file-based database that already exists, is it possible to write the Data Context classes (i.e. the ones I added to the designer) to create the db schema?
With a data context I only see the abilities to either:
create a new database file and have its structure created at the same time,
or to populate...
Hello,
I am trying to come to a working understanding of how databinding works, but even after several tutorials I only have a basic understanding of how databinding works. Thus this question might seem fundamental to those more familiar with silverlight. Even if it is trivial, please point me to some tutorial that deals with this prob...
I'm trying to get data from file. The file first has three lines of text that describes the file, then there is a header for the data below. I've managed to extract that. What I'm having problems is getting the data below the header line. The data below the header line can look like "1 2 3 4 5 6 7 8 9 abc".
DataGrid d...