none
moving from all stored procedures to typed datasets RRS feed

  • Question

  • Hello,
    I'm new to typed datasets (I used only stored procs and straight ado.net to simply execute themin the past). I'm working on something for the .net compact framework so I don't need to worry about choosing between linq to sql or linq to entities, typed datasets are my only option, and thats fine with me.

    however, I need to get started quickly in transitioning from the stored proc method to the typed dataset model... I created the typed dataset using the vs 2008 sp1 dataset designer surface.. all my tables are there. I have verified connectivity from my emulated pocket pc device to my sql database and am ready to get going. 

    1. by default the designer creates methods that return all field and rows. I can see where you can restrict fields using the query designer or right in the sql code, but what about restricting rows with parameterized queries?

    2. what about when you need to do table joins? again, coming from using stored procs I am used to just making a call and only getting back the exact data I need... I'm not accustomed to using c# to join and query and filter the data. How do I implement methods that would both use joins and parameters? Just edit the sql directly?

    3. can you have 2 or more tables joined as one datatable/tableadapter instance on the designer? should you? I am probably not using the right terminolgy, in case that is not clear what I mean is, when you drag a table from server explorer onto the designer surface, it creates that representation of that table on the designer surface, it represents that one table, is it possible to have one of these that is already representing a join?

    4. if you have a table that has tons of fields, is it customary to just create more queries, or would there be reason to drag another instance of the table onto the designer with a different subset of fields?

    My project is pretty simple, dealing only with 3 main tables and a couple more that are only for quick lookups as part of some BLL logic. I just need that basic getting started info, for typical CRUD work, master/detail views, etc..

    answers/comments/suggestions pertianing to these specific questions would be greatly appreciated, and any links to some getting started quickly guides/tutorials would be helpfull as well.

    thanks!
    Tuesday, March 9, 2010 8:51 PM

Answers

  • pretty  much found everything I need to get started right here:
    http://www.asp.net/learn/data-access/tutorial-01-cs.aspx

    I just need further info on how to implement typed dataTables resulting from sql JOINs... this tutorial mentions them but does not provide details on how to... but I'm not sure at the moment that I need them yet, so I'll create a new thread if/when that time comes.
    • Marked as answer by c0pe Wednesday, March 10, 2010 3:09 AM
    Wednesday, March 10, 2010 3:09 AM