I am trying to switch from LINQ2SQL to EF ... I am getting the following error with some code that originally worked with LINQ2SQL and seems to compile correctly:
Csla.DataPortalException:
DataPortal.Fetch failed (LINQ to
Entities does not recognize the method
'MyApp.Logic.UserInfo
FetchUserInfo(MyApp.Data.User)'
method, a...
Hi,
I'm looking for a way to expose a subset of my existing business layer (which is based on LinqToSql) via WCF Data Services so that
The Data Service can still be consumed (read AND write) by older odata clients as my business layer evolves over time. It seems that the only way to guarantee this is by making sure the data service do...
You know we are writing codes. on the other hand; we are changing DBML files if add or change database table. i droped my tables and added new tables. My DBML does not include new columns names. in My Database ENG_MAINWP_SELECTED_X is not the same as DBML this column ,n my dbml : ENG_MAINWP_SELECTED_X_
Why this strange behavior occur...
Im getting error whenever i fetch like this
Feature f = o.Features.SingleOrDefault(e => e.vcr_LinkName == PageLink && e.bit_Activate == true);
because this can return one or more than one element. so what is the alternative approach that i can use to solve this issue
...
Is there a way to use a custom data type in the entity returned by Linq to SQL?
Say I have a data type like this:
public struct CustomerNumber : IEquatable<string>
{
private string _value;
public static implicit operator CustomerNumber(string value)
{
return new CustomerNumber { _value = value };
}
...
}
...
SQL Server 2008 Ent
ASP.NET MVC 2.0
Linq-to-SQL
I am building a gaming site, that tracks when a particular player (toon) had downed a particular monster (boss). Table looks something like:
int ToonId
int BossId
datetime LastKillTime
I use a 3d party service that gives me back latest information (toon,boss,time).
Now I want to update ...
How to modidy entity in query?
I have code like this:
var res = from p in dc.Folders
group p by p.FolderId into gr
let DDate = gr.Where(a =>a.status ==5).Max(g=>g.MDate)
from c in gr
select c;
Folder class has extra member not mapped to db called DDDate, just for example.
How I can set this memb...
I'm new to Linq2Sql and to learn it I'm trying to setup reports using Linq2Sql against the FogBugz tables. But, since the FogBugz tables don't have any true Foreign Key relationships, LinqToSql isn't finding the relationships and I can't figure out how to create them through the Designer. So, is there a way to do this manually? If I do i...
I have a Linq-to-SQL context with changes in an EntitySet. I want to get rid of all the changes I made to it since I last called SubmitChanges(). I use the following method to revert the state of the context:
public static void RevertChanges(this DataContext context)
{
var changeSet = context.GetChangeSet();
var inserts = change...
Hello,
Several "parts" (a WinForms app for exmaple) of my project use a DAL that I coded based on L2SQL.
I'd like to throw in several WebApps into the mix, but the issue is that the DAL "offers" much more data than the WebApps need. Way more.
Would it be OK if I wrapped the data that the websites need within a web-service, and instead ...
Looking for suggestions on cleanest way to get the return value and the result set (without passing a referenced parameter to the stored proc).
MY stored procs have return values to show errors, etc and they end with a select statement to get the information. With regular commands I would create an output parameter which would hold th...
I am a little new to linq-to-sql. I was just thinking suppose you wanted a subset of fields (in your db table) to actually be a data model in your application, what do you do? What I have thought of so far is to create a view from the actual db table and build linq-able classes using it.
Or is there a better way of doing this?
...
i have table
id pagenane username
i want this sql query
select pagename, count(*) as num from pagestat where username='name' group by pagename
how can i do it by linq?
...
Is it possible with LINQ to SQL to search the entire database (obviously only the parts that are mapped in the .dbml file) for a string match? I'm trying to write a function that will take a string of "Search Term" and search all mapped entities and return a List(Of Object) that can contain a mixture of entities i.e. if I have a table "F...
Hello,
I have a SQL Server 2008 stored procedure (pseudocode below) that goes as follows:
CREATE PROCEDURE MyProc
AS
BEGIN
CREATE DummyTable
INSERT INTO DummyTable
SELECT xxx
INSERT INTO DummyTable
SELECT yyy
IF EXISTS FinalTable DROP FinalTable
EXEC sp_RENAME 'DummyTable', 'FinalTable'
END
GO
Note that there is no retur...
I would like to be able to use DataAnnotations when working with my model, so for instance be able to write stuff like
[DisplayName("Title")]
[StringLength(256)]
public string title { get; set; }
I also want to be able to use the column with linq which has led me so far to adding table and column linq mapping annotations such as
[C...
I am having problems with postbacks.
I have a dropdownlist that i add items to at runtime.
When i select a item in the dropbox a treeview is filled with items that have the same pID value as the object selected in the dropdownlist.
But when i select a node in the treeview everything goes back to "normal" state. The dropbox will go to s...
Hello,
I have a Table to store constants with columns(Name, Value). How do I go about getting the result of LINQ query in name value format like (Name = Value) so I can obtain the values like
Var thisVal = VarCollection("Name")
Hope this is clear.
Thanks in advance.
...
In our Smartclient app we currently use PostSharp to inject get/set code into auto properties to implement Dirty state tracking and INotifyPropertyChanged events.
We often use these business objects with LinqToSql. We'd like to remove this dependency on Postsharp, and the .Net 4.0 ExpandoObject looks perfect. We can add dynamic properti...
Possible Duplicate:
Are there good reasons not to use an ORM?
I've just started learning what an ORM is and how it can help me save time and make applications more secure. Since this is new to me, after using ugly SqlCommands and whatnot in my C# code, this is the best thing since sliced bread.
However since I'm new I might n...