hi
I want to use MYSQL database for accesssing the data in a mvc application.
The connection string that i am using in web.config is:
Then I have prepared a model,controller,view for accessing and displaying the data.
I am using LINQ o get the data from database but getting the exception:" A network-related or instance-specific er...
Lets say I have two L2S classes generated by the designer with one property as follows:
public class A
{
public bool IsActive {get;set;}
}
public class B
{
public bool IsActive {get;set;}
}
I have a generic DataAccess class as follows:
public class DataAccessBase<T> where T : class
{
NWDataContext dataContext = new ...
I have a MySql database, whose general structure looks like this:
Manufacturer <== ProbeDefinition <== ImagingSettings
ElementSettings ====^ ^==== ProbeInstance
I'm using InnoDB to allow foreign keys, and all foreign keys pointing to a ProbeDefinition have set ON DELETE CASCADE.
The issue I'm having is when I delete a ProbeDefinit...
Hello =)
I want to make my queries better but have been un-able to find a resource out there which lays out when a query is shipped of to the db.
DBContext db = new DBContext();
Order _order = (from o in db
where o.OrderID == "qwerty-asdf-xcvb"
select o).FirstOrDefault();
String _custName = _order.Custo...
This is a similar problem to this question
When I deployed my dev app to the prod server I was getting an error:
System.Data.SqlClient.SqlException: Invalid object name 'dbo.Login'.
The table attribute on the linq mapping looks like [Table(Name="dbo.Login")]
When I loaded the prod db schema into the vs2008 server explorer and refresh...
Hi,
I am trying to implement a logical delete senario across all my entities. All have an IsDeleted boolean property. I would also like to cascade the association deletes also. I started by adding a partial method for the entity to the datacontext.
partial void DeleteQuestion(Question instance)
{
instance.IsDeleted = true;
Exec...
Could anyone suggest the proper way for binding LINQ to SQL queries in Windows Forms controls? Should i follow the standard way with BindingSource and handle the events to have change tracking while various values changing from the controls. This kind of binding will involve hierarchical object binding too, EntityRef<>, EntitySet<>.
Now...
This is an odd one. All the sudden when I create LINQ to SQL projects in Visual Studio would it not create the following line in the designer, up to three weeks ago or so, it used to create this line, now I have to manually do it. Then if I make changes in the dbml file it removes it and I have to manuallhy add again. huge pain. Here is ...
If I am using SQL Server as my database service, is there any compelling reason to look at LINQ to Entities over Linq to SQL?
...
If multiple queries to one and the same large table come to SQL Server at the same time, how SQL Server resolves conflicts in this case?
When using LINQ to SQL queries in WPF application for install on many PC's, working in network with SQL Server database, should I somehow implement mechanism for resolving such issues or am I protected...
I am trying to figure out what I am doing wrong in the below LINQ statement. It doesn't like the third SELECT. It finds tblAddresse.tblAdminCounty in Intelisense when I am typing the query but when I type the SELECT after it it freaks.
Does it have to do with how tblAddress and tblAdminCounty are related? I would have thought that ...
Hello,
I need some EXAMPLES or IDEAS on how to created dynamic breadcrumb control which will dynamically generated breadcrumbs for Dynamic Date framework powered by LINQTOSQL
...
I have to below 2 LINQ statements. They both return (seemingly) the same result set. Can anyone explain to me why I should use one way versus the other? Is it as simple as "You say potato, I say potato; you say tomato, I say tomato"?
Here are the two flavors of LINQ -->
1) The two lets below are to private Methods that take an ID an...
I'm just not understanding on how to create a lamdba expression instead of using a regular comprehension linq queries. All of the examples i see are not query a database using linq to sql. i want to able to construct a lambda expression that get my the orders from the northwind database where the country equals "us". I know how to constr...
Somebody knows the answer? I'm using L2S with field ntext in my db
...
Why I am getting this error:
The method 'Single' is not supported by LINQ to Entities. Consider using the method 'First' instead.
public ActionResult Details(int id)
Line 27: {
var result = (from d in _db.MovieSet
Line 29: where d.Id == id
Line 30: select d).Single();
//
...
I'm kind of new using LINQ to SQL and when ever I try to use a non sql server dbs I get an error that it is an unsupported data provider. Is there a way to get LINQ to work with dbs like Oracle and SQL sdf files?
...
On Sql server we have multiple joins viz. left outer join, right outer join, full outer join, self join
Can anyone given an example each on LINQ..? And how to achieve the same result with Extension methods...?
...
The ASP.NET linq SubmitChanges method commits changes for all previous database modifications since the last time it was called.
I have a case where I do something like the following:
ClassX x = new Abc.Linq.ClassX();
DataContext.InsertOnSubmit(x);
ClassY y = new Abc.Linq.ClassXY();
DataContext.InsertOnSubmit(y);
DataContext.SubmitCh...
I have some code like this trying to get some data from a Documents table based on some filters passed in (ContentRef and TypeRef)...
public IQueryable<Document> GetFilteredDocuments(bool archived, int? ContentRef, int? TypeRef)
{
return from document in db.Documents
where document.IsA...