Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > LINQ
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
LINQ Discuss Microsoft's LINQ (Language INtegrated Query) for .NET 3.0 and later.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the LINQ section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #21 (permalink)  
Old December 31st, 2008, 06:34 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

It maintains state over active results sets.

It is my understanding that a DBML file is not connected to the datastore all of the time it only connected when you are working with data or are making queries against the DBML file and thus the data store.

Remember, the DBML file is just a bunch of classes that are representations of your physical tables, it doesn't actually contain any data so when you run XYZ query of course it is going to have to connect to the database preform XYZ query and return.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
  #22 (permalink)  
Old December 31st, 2008, 10:34 PM
Authorized User
 
Join Date: Dec 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

we have like 400 tables in our database. Is it ok to have all of it in a Datacontext? to have ONE datacontext to contain the tables/stored procs and just use this thru out the app?
  #23 (permalink)  
Old December 31st, 2008, 11:03 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

O.o Wow, that sounds like a data-warehouse or a poorly designed database!

I have not read anything that would indicate that L2S can not support that many tables but, to me, it would seem a management nightmare because the DBML file is not "aware" of the database. What this means is that if a DBA or database programmer goes in and changes a varchar(10) field to varchar(5) , for example, and doesn't inform you your app will start spiting out truncation erros!

This isn't a huge deal since you can simply go into the DBML file and "refresh" it so that it updates itself to mirror the database . This really isn't any different then any other DAL issue but it is worth pointing out.

My other fear would be that the DBML file would grind VS to halt trying to render all of the tables and such this isn't to much of a problem as long as you aren't trying to work with said file but it would definately be something id look into.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
  #24 (permalink)  
Old December 31st, 2008, 11:31 PM
Authorized User
 
Join Date: Dec 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i wanted to have separate DBML files for each section of the app/group of tables but my coworker put all the tables in one DBML file.

Isnt it better to have DBML files for each group of tables? She says it's easier to have one DBML file. Easier to compile and maintain.
  #25 (permalink)  
Old January 1st, 2009, 12:31 AM
Authorized User
 
Join Date: Dec 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.sidarok.com/web/blog/cont...rformance.html

step number 2 says not to dump everything in one datacontext.
  #26 (permalink)  
Old January 2nd, 2009, 08:41 PM
Authorized User
 
Join Date: Dec 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

We set the Default Tracking mode to off/false. Is that ok??

coworker did it because she couldnt serilaize the datacontext.
  #27 (permalink)  
Old January 4th, 2009, 03:30 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You are starting to ask questions that I can't really answer. The things that you are doing are, obviously, specific to the project that you and your co-worker are working on. To this end, it is counter productive for you to come here and "check up" on the things that your co-worker is doing to make sure if they are "ok". In an ideal world you and your co-worker would be talking about these types of things and weighing the pros and cons of each decision and looking at how the decision will ultimately affect the application.

Whether or not you should do this depends on the objects. If the objects in question are going to be updated, deleted, and so on then I probably would not turn tracking off. If, however, you are only using this objects for readonly operations, then it should not be a problem.

And you should probably read this article as well:
http://www.west-wind.com/Weblog/posts/313037.aspx

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
  #28 (permalink)  
Old January 4th, 2009, 03:32 PM
Authorized User
 
Join Date: Dec 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks. I work with a narcissist. I'm serious. So, i have to double check everything before i open my mouth. Thanks. You've been very helpful. I also bought a book and will go thru that as well.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 AD HOC Testdriven.net tests? phsarjk BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 1 May 17th, 2007 05:12 PM
Calling an insert stored proc from a select stored dzitam SQL Language 10 April 2nd, 2007 01:39 PM
How to get value from stored proc busybee ASP.NET 1.0 and 1.1 Basics 4 April 2nd, 2006 01:06 AM
Ad Hoc Query Classes Bob Bedell Pro VB.NET 2002/2003 0 September 21st, 2003 02:32 AM



All times are GMT -4. The time now is 12:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.