1,490 questions
2
votes
0
answers
114
views
Does DataContext.Connection share settings accross different Datacontexts
When using linq2sql to access a database, I create a new DataContext. As far as I understand, the underlying DBConnection is pooled, and may be reused.
using (var dc = new DB_DataContext())
{
//...
0
votes
0
answers
297
views
How to bind to Datacontext of selected TreeViewItem?
I have a TreeView like so:
<controls:TreeView x:Name="treeView"/>
I try to bind the Datacontext of a different control to the Datacontext of the selected TreeViewItem. How would I go about that?...
1
vote
0
answers
205
views
How to insert a meteor template into summernote editor?
I need a button that insert my meteor template into summernote editor.
I have a custom summernote button:
var MyButton = function (context) {
var ui = $.summernote.ui;
var button = ui....
4
votes
2
answers
4k
views
Self DataContext binding not working in XAML but working in code behind
When I am trying to bind Datacontext of Window by DataContext="{Binding RelativeSource={RelativeSource Self}}" it is not working, how if I do the same thing in code-behind, it is working quite fine.
...
1
vote
1
answer
304
views
For DataContext, GetChangeSet stops working after SubmitChanges
In our project, we have multiple System.Data.Linq.DataContext objects for the different Windows forms.
When databound controls on the form are changed (like the Name), we enable or disable the Save ...
-1
votes
2
answers
790
views
Setting datacontext inside ViewModel
I have a MainWindowView that has a grid with 2 columns each having 1 UserControl View. MainWindowView constructor creates instance of MainWindowVM and sets the data context to this new instance.
this....
0
votes
1
answer
154
views
How to make a Save/Reset options page that has two sub-pages using WPF and C#
I would like to make a page that contains two sub-pages of options.
The problem I've encountered is that I can't access the objects from sub-pages of the main page. I should note that I use only ...
0
votes
1
answer
400
views
How to "clear" data context
Some my script updates local data from external resources, get part of data, update and then get next part of data... my update code is:
public void UpdateDrivers(List<Domain.POCO.Vistracks....
1
vote
1
answer
75
views
Random LinQ-SQL errors and sudden database closing
There are 2 or 3 errors that are thrown sometimes in my ASP website. This usually happens when I go from a page to another very quickly. Usually, when I give it time, it does not
They are all related ...
1
vote
1
answer
5k
views
Fastest way to create DataTable from List without for loop
We have a huge list (say 100,000) which needs to be converted to DataTable for SqlBulkcopy.
Can you guide what could be the fastest way to do this without using for loop?
For now we are doing it ...
0
votes
1
answer
173
views
Set DataContext to a view in a TabItem
I have a ViewModel that handle a view called "WorkSpace". Now without going into non-useful details, to create a new tab inside my TabControl contained in this workspace, i raise an event with the ...
2
votes
2
answers
2k
views
Order of setting the DataContext in the default constructor in WPF
I experiment with the order of setting the DataContext property in the default constructor in WPF.
<StackPanel>
<ListBox ItemsSource="{Binding MyItems, PresentationTraceSources....
0
votes
1
answer
276
views
Devexpress MVC datacontext
I have a problem with the system for ordering products.
Scenario:
Two separate browsers
Two separate accounts (after logging in a separate session id)
when clicked, grouped, and enabled in the connect ...
0
votes
0
answers
104
views
Add Table to DataClass without Associations
I'm using Linq on a third part database and I have DataContext that contains all my tables I've used so far. I'm trying to add another table and have run into what I think is a database design issue, ...
2
votes
1
answer
419
views
Datacontext models with join
I’m trying to get details about the business when I get a deal.
I want to translate this query:
select d.*, b.* from deals d inner join business b
on b.id = d.businessId
where d.IsEvent = true
I ...
3
votes
2
answers
11k
views
Inconsistent accessibility: field type is less accessible than field [duplicate]
I've finally started implementing Linq in our old API so I started making all the classes associated with our Tables and DB classes for the Database I followed an online guid but I can't get it ...
0
votes
0
answers
113
views
Assigning DataContext to a public variable
I'm messing with LINQ, and I'm trying to save lines of code. I created a variable in settings to indicate if I'm in Stage or Production, and I need to be able to switch between the two versions of the ...
1
vote
2
answers
2k
views
How to bind from DataTemplate to Page's DataContext?
I've got a page where a DataTemplate is being used to bind to the model for that content, e.g.:
<DataTemplate x:DataType="models:MyDataType">
... content ...
</DataTemplate>
In that ...
0
votes
2
answers
212
views
Get right context(this) in callback
I try to call a function in a callback and do something with the class context(this). But when calling the callback function, it doesn't have any context. this is undefined. I tried a few things with ...
1
vote
3
answers
770
views
ASP.NET How to update a record without manually setting each property?
What if I have an object with a 100 properties that changed?
This would be horrible to code and prone to missing some properties.
Is there a different way of updating a record than to do it manually?...
0
votes
1
answer
332
views
c# DataContext CreateDatabase isn't working, if database-file is deleted
I create an application, which uses a local database, which is stored in the AppData folder. I created a DataContext to get the data:
private NorthWindDataContext northWindDataContext = new ...
1
vote
1
answer
745
views
WPF Datacontext Sql Update, Delete, Insert
I want to create a WPF Application with a SQL-Connection to a Database. For my test application I'm using the NorthWind database. I followed this Tutorial on MSDN to create the DataContext class and ...
0
votes
2
answers
1k
views
Add entity using factory repository pattern
I have the interface.
public interface IRepository<T> where T : class
{
void Add(T entity);
void Update(T entity);
void Delete(T entity);
void Delete(Expression<Func<T, bool&...
2
votes
2
answers
5k
views
How to set data context for user control with prism wpf?
This my view.xaml:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height=".5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Grid ...
2
votes
0
answers
240
views
How to deal with changing OData signatures in .NET DataServiceContext Service Reference
dear lovely community,
I need some help with .NET Service Reference stuff for OData services.
The webservices (Odata endpoints) for information download are located on container ships with different ...