WPF/LINQ to SQL DataContext Best Practices

Hello,

Putting aside for the moment whether or not I should be using LINQ to SQL or 
Entity Framework, I'm looking some best practice advice for managing the 
LINQ to SQL DataContext behind my WPF application.

As far as using LINQ to SQL, I understand that MS will not end support for 
it, however that they will provide a migration path to Entity Framework and 
will recommend Entity Framework over LINQ to SQL. Is that correct? Is there 
a migration tool available?

With regard to my existing project (which is about to be deployed,) should I 
be considering moving to use the Entity Framework over LINQ to SQL sooner 
rather than later?

Thanks,

Bill


0
Bill
11/13/2009 7:03:18 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

2 Replies
3302 Views

Similar Articles

[PageSpeed] 13

Bill McCormick <wpmccormick@community.nospam> wrote in
news:uSLInNJZKHA.1596@TK2MSFTNGP06.phx.gbl: 


> With regard to my existing project (which is about to be deployed,)
> should I be considering moving to use the Entity Framework over LINQ
> to SQL sooner rather than later?

I would say yes, if it is feasible with your project, but it is not as hard 
as it sounds with LINQ to Entities bits in the LINQ project. There are 
still some investment in LINQ to SQL in .NET 4.0, so you will have some 
time before this decision is forced on you.

Peace and Grace,
Greg

-- 
Vote for Miranda's Christmas Story
http://tinyurl.com/mirandabelieve

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
|      Think outside the box!             |
*******************************************
0
Gregory
11/13/2009 7:31:41 PM
Bill McCormick wrote:
> Hello,
> 
> Putting aside for the moment whether or not I should be using LINQ to 
> SQL or Entity Framework, I'm looking some best practice advice for 
> managing the LINQ to SQL DataContext behind my WPF application.

I can't help you there.

> 
> As far as using LINQ to SQL, I understand that MS will not end support 
> for it, however that they will provide a migration path to Entity 
> Framework and will recommend Entity Framework over LINQ to SQL. Is that 
> correct? Is there a migration tool available?

<http://microsoft-net-development.blogspot.com/2009/10/microsoft-creates-tools-for-migration.html>

Moreover, Microsoft has already released the first version of Visual 
Studio 2010 templates for LINQ to SQL (.dbml) metadata migration to 
ADO.NET Entity Framework (.edmx) models which proves their strategical 
intentions to abandon LINQ to SQL in favour of ADO.NET Entity Framework

> 
> With regard to my existing project (which is about to be deployed,) 
> should I be considering moving to use the Entity Framework over LINQ to 
> SQL sooner rather than later?


I would say new development should be done with EF. As far as your 
existing Linq-2-SQL project, if not pressed to upgrade to EF, then to me 
if it's not broke, then why fix it? But if it were me personally, I 
would abandon Linq-2-SQL.

0
Mr
11/13/2009 7:33:43 PM
Reply:

Similar Artilces:

load cobol file to sql table
hi, Anyone knows how to load a cobol file to sql server table? I tried bulk insert, I got problem with the special char 3 small square + / If I select the records I don't see any char after 3 sqare + / thanks, Don't know the file structure, but if it's a some form of fixed-width or delimited file you can use SSIS, or you can use BULK INSERT/bcp with a format file. "Mecn" <mecn@yahoo.com> wrote in message news:u9toxhEdKHA.4952@TK2MSFTNGP06.phx.gbl... > hi, > > Anyone knows how to load a cobol file to sql server table? > &g...

Help with SQL statement
-- Jon Kahn Confluence Kayaks ...

Witness Server in SQL Mirroring
Hello everyone, is there someone who could tell me if the witness server in a mirroring configuration under SQL Server 2008 must be a third instance of a SQL Server? Can I setup the secondary DB within the mirroring as the witness as well? Thank' you for your help! Bye, Clark. -- =^= Live Long and Prosper I don't believe there is anything stopping you from doing so but that pretty much defeats the purpose. For instance if the witness is on the same server as the mirror and the network connection drops both the witness and the mirror will create a quorum and pro...

Item Import T-SQL
Does anybody have the T-SQL code to do bulk item importing in HQ. I have about 360,000 items, of which most were imported in SO before starting using the system in HQ. However, once you start using HQ, it has a new table called ItemDynamic, plus the SupplierList. I can still import items, but then you dont have info for the stores & tax. A utility can be built that updates these items, but is complex. Please reply if you already have a utility, or would like to help build one. I need one that will CREATE and item if not there, or UPDATE item description and cost if it is there...

How best to set up credit card purchases which are paid out of chequing
I want to make purchases with a credit card... which I will immediately pay off thru my chequing account. With the credit card acct. I can specify the categories of purchases for budget & reporting purposes, but what do I put on the chequing account for my credit card payment? Won't that show as extra expense on my budget ?? How best to handle it? Also, how best to handle cash withdrawls from ATM from chequing acct. Creatinfg an account called cash is what I'm doing but when I fund it from chequing... it is like extra income and will distort my income amounts....no?? In micros...

CRM 4
We had a CRM 4 setup which was working successfully: - Server 1 is a Windows 2003 Server with CRM Server installed - Server 2 is a Windows 2003 Server with SQL 2005, Reporting Services with CRM Data connector installed The SQL 2005 server was upgraded to SQL 2008 Enterprise. After the installation and rebooting, the CRM Server was working apart from Reports. REPORT ERROR MESSAGES ====================== When a report is run from a CLIENT machine, the following error appears - "The request failed with HTTP status 401: Unauthorized." [WebException: The request failed with HTTP status...

Importing XML in SQL Server 2005 in .Net 2.0
Hello All, I tried using bulkupload SQLXML, but it is very unreliable. Is there any way we can import XML file having schema into database? Neo Hello Neo, N> I tried using bulkupload SQLXML, but it is very unreliable. Is there N> any way we can import XML file having schema into database? What exactly are you trying to do? e.g., load XML into an XML typed column or load XML into one or more tables? Do you already have a schema? Note: Adding to m.p.ss.xml for easier tracking. Thanks! Kent Tegels DevelopMentor http://staff.develop.com/ktegels/ Yes, I have schema. I have also c...

Looping through table to build sql case statement
Hi, I have the following sample table. cust_num slsman site sales_ytd c000200 904 11199 1023.1 c000200 904 11121 2000.12 c000201 927 11199 325.12 c000201 927 11121 245.5 Also I have the following site table prototype Site 11199 11121 The output of the select statement should be like the following: cust_num slsman 11199_sales_ytd 11121_sales_ytd c000200 904 1023.1 2000.12 c000201 927 325.12 245.5 This has been achieved through hardcoding the following. The results are exactly as I would like above select cust_num,slsman, SUM(CASE WHEN [site] = ...

i need an sql or .net expert !
it seems like a simple enough problem, but i need some help...... i have a table of messages (like newsgroup messages) in sql server. my application will allow people to read threads/messages and reply to messages over the net. the table has the following columns: messageId - unique primary key parent message id - if someone replies to an existing message, the parent message's id goes here. (if message has no parent then this will be 0). root message id - the id of the first message in the thread. subject - the subject of the message text - the main text of the message. basically, what...

General T-SQL Question
I have two tables that I want to combine. The two tables to NOT have a common field. Here is table one: Description ---------------- A B C Here it table two: Quarter ------------ 1 2 3 4 I want the merged data to look like this: Description Quarter A 1 A 2 A 3 A 4 B 1 B 2 B 3 B 4 C 1 C 2 C 3 C 4 I was considering a C...

does this sql capability exist
Hi, I have two questions: 1. Is there a way to dynamically choose which fields are included in an sql statement based on if there is a value entered in text boxes? I have 10 text boxes that represent 10 of the fields in my table tblCorePart. These text boxes are labeled with quantity ranges. These are the ten fields: Table: tblPriceListCore Field Name: Data Sample: Description: ID Primary Key CORE_PART 217 Part Number ADAPTER_CONFIG R 1-9 ...

SQL Insert / Integration Manager
Ok, I have been asked to upload into the database all ISO3166 2 character country code listings. The table I have identified is VAT1001. Fields are CCode, CCodeDesc, ECFLAG, NOTEINDX, DEX ROW ID. Now, I have no problem putting in data for the first 3 fields,b ut NoteIndx and Dex Row ID are system generated. I have Integration Manager for Distribution but I do not see where it would have me upload to VAT1001. So, 1. is this possible with Integration Manager for Distribution 2. Is it possible to just do a SQL insert (via MS Access) and will GP during the next check links fix t...

Best format to share Publisher Created Documents
I have created publisher documents and need to share them so others can print them from their e-mail. What is the best format to do this? pdf, jpeg and how do I convert them? I am running Publisher 2000 and neither of these are options in my Save as drop down. Thanks--Susan Susan R wrote: > I have created publisher documents and need to share them so others > can print them from their e-mail. What is the best format to do > this? pdf, jpeg and how do I convert them? I am running Publisher > 2000 and neither of these are options in my Save as drop down. > Thanks--Susan ...

SQL Upgrade
-- Thanks Titan ...

Final SQL Question of the Week!
To Bud, Victoria and Richard- thank you for all your help. You folks are a really great resource which I feel I have taken advantage of as of late! That said- Here's one more... I currently run a Smartlist in Sales/Sales Transactions where I search on Document Type "Order" and use document dates to include all of the current year and then I also search on void status of "not voided". This gives me a listing of all orders booked for the current year with the original order amount. I tried in SQL using table SOP10100 but the querie only returns a partial list...

SQL Server 2005 Maintenance Plan
Hello, I used the 'Back Up Database Task' which backs up all of the databases automatically in one step but noticed for the past few days it's actually creating multiple file names for each day for example at 6:00PM as: UserDB_backup_200911031800.bak UserDB_backup_200911021800.bak UserDB_backup_200911011800.bak ....is there a setting when double-clicking on the 'Back Up Database Task' step to have it use one file only like 'UserDB_backup.bak' in where it overwrites a full db backup each day instead of multiple files like shown above? T...

1.2 & SQL RS
Ok i have looked through most if not all of the previous posts but all have had 1 server with everything on it. We have a Server with CRM and SQL on it, and another server just for RS. What i want to do is be able to connect the RS server to the CRM box, but i get permission errors...even with a dedicated logon i still cant get a connection...is there something else i need to do, the RS server can connect to any of our other SQL servers no problem... Cheers in advance Ben ...

Best way to take Exchange 2003 install off a DC??
I have a client with Exchange 2003 installed on a Windows 2003 Domain Controller that's also a GC. What is the best approach to migrate Exchange 2003 off and retain just the Windows 2003 Domain Controller? There is a separate DC in the same domain that holds all the FSMO roles. From what I read, the Exchange server should be moved off, not the DC role. Any thoughts? thanks in advance install exchange elsewhere, move all mailboxes and public folders, uninstall exchange "dude" <dude@aol.com> wrote in message news:uJ$jdZRzGHA.480@TK2MSFTNGP06.phx.gbl... >I ...

Question: SQL Server 2005 post-sp3 updates
Hello, I have a SQL Server 2005 SP3 running on a server with 12Gb of RAM and 4 processors (production environment). The server's performance is not that great. That is, processors often hit over 95% capacity and disk queue length is high. I'm wondering if there has been any release that adresses the SQL Server performance. Since the release of SP3 back in 2008, there were a few more updates: • SQL Server 2005 9.00.4207.00 2005 Service Pack 3 + Cumulative update package 1 • SQL Server 2005 9.00.4211.00 2005 Service Pack 3 + Cumulative update package 2 • SQL...

All in one Windows 2003 Server as PDC with SQL and CRM
hello, can i install an Microsoft CRM Production Server as an All-In-one Solution with Microsoft CRM and SQL 2000 Server on the PDC (Windows 2003 Server)? Is this supported? What are the possible disadvantages besides not having an secondary Domain Controller for extra security? Andy in a testing environment this works but in production is not a good idea. The only supported single server deployment is sbs 2003 etc. why not supported? apart from SBS you should never start treating your domain controllers as application servers as if anything goes wrong you risk losing your entire AD....

Can't see default instance of sql 2008; login name oddness
I am seeing two odd characteristics with a new windows 7 x64 box. The install and config steps were like so: [1] Computer OS installed, computer named Comp1. [2] Install sql server std 2008, developer version, including ssms, as default instance [3] Install sql server express 2005, named instance (sqlexpress). [4] Change computer name to Comp2. It's possible that the timing of 3 and 4 are reversed in the list above. The two oddities are that when I browse for sql servers on this box (browse service is on) I see only two entries: Comp1\sqlexpress Comp2\sqlexpress IE...

Can any one tell me which one is best? #6
Im trying to pick a mortgage but i dont understand the ins and out can any one tell me which of these is the best? http://www.swoopon.com/Swoopon/mortgage.htm ...

Service-Oriented Architecture(SOA)
Service-Oriented Architecture(SOA) - Principles & Practice (October 2006) The Principles of SOA,Loosely-Coupled Architecture,The SOA Solution - How it Works,The iBOLT Flow Editor, Composite Applications,Implementing a SOA with iBOLT http://flying-rugs.com/soa/ ...

Want to average values grouped by value in a certian column (sql example included)
It can be done with SQL using: SELECT Day, AVG(Users) Avg Users FROM NOTESMON GROUP BY Day But that is not very portable On the attached sheet the statement needs to take every value from th User column (J) where the Day column (H) was the same, add them up, an take the average of them. So if Day was 30 for the first 10 rows it would take the value in th users columns for those 10 rows, get their average, and plop it ou next to the vaule of the day, so it would be 30 and then next to tha the average value of all the entries of User that correspond to 30 Advice Attachment filena...

Best way to have user with multiple mailboxes
I have a user "John" that has his own mailbox. He wants to have 2 more mailboxes that he can use to send automated messages. The mailboxes are "Scheduled Maintenance" and "Audits". He wants "Scheduled" to send automated messages to Test, Engineering, Purchasing to get equipment calibrated. He wants "Audits" to send messages to departments to review processes. Setting up the boxes are not a problem, however they appear in the address list and I do not want that. If I set the addresses to hidden, he can't use Outlook 2000 to open...