VS2008: should data sets be placed in App_Data?

D

dan

I'm working on a small Web project in VS2008. In VS2005 it was recommended
that DataSet be placed in App_Data folder (the framework did that
automatically). In VS2008 the framework does not give me that option. The
Add.New Item in the App_Data context menu does not even list the DataSet.

Does anyone know what is behind the change and what the recommended practice
is?
Thanks.
 
J

Juan T. Llibre

Datasets are usually stored in memory, as an in-memory database.

Are you writing the Dataset to a file ?
If not, using App_Data doesn't make sense.
 
P

Patrice

Try to add them from the main menu. It should suggest to add them in
App_Code...

It looks like to me you are confusing DataSets with data files (such as a
SQL Server MDF file) ???
 
D

dan

In VS2008 it does not suggest as it used to in VS2005. The only way to
place DataSets (i.e. xsd) in App_Code is to drag them into the folder after
creating them. It is not a big deal but I'm curious what the best practice
is.
Another difference is that when you Add a DataSet the TableAdapter wizard is
no longer automatically launched.
Does your VS2008 behave like VS2005 in the above scenarios?

And I don't mean data files.
 
D

dan

I did not mean instantiated DataSets objects at run time. I was referring
to the process of creating/adding strongly typed data sets to a project in
VS2008 (i.e. Solution Explorer.Add New Item).
 
J

Juan T. Llibre

re:
!> DataSets (i.e. xsd)
!> I was referring to the process of creating/adding strongly typed data sets to a project

Datasets aren't the same as XSD schema.
An XSD file is a schema class that defines what your xml will look like, not including data.

http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=97

Also, see :
http://msdn2.microsoft.com/en-us/library/ex526337.aspx

"Arbitrary file types can be placed in the App_Code folder to create strongly typed objects.
Placing Web service files (.wsdl and .xsd files) in the App_Code folder creates strongly typed proxies."
 
P

Patrice

Yes, I have the same behavior that is if I chosose "WebSite", "Add new
item", "Dataset" it suggest to add to app_code. BTW which model are you
using for your project (web site or web application ?)
 
D

dan

I just noticed that made a silly mistake in my original post. It should've
read 'App_Code' instead of 'App_Data'.
Sorry about the confusion.

I'm going back to VS2005. Could not get it to work. I've got also other
issues with VS2008: no table templates, no ATL server libraries for native
development, etc. Simply not worth the trouble.

Thanks to everyone who tried to help.
 
D

dan

I made a mistake in my original post - I meant "App_Code". Sorry about
that. Anyway, in VS2005 when I add a DataSet to a project the framework
auto-suggests to add it to "App_Code" folder. VS2008 does not give me that
option and associated xsd files are placed in the root instead. As I said,
a minor thing but still annoying.
 
D

dan

I know that they are not the same and I never implied that. But again,
strange things happen if English is not your native language (like in my
case). I meant "DataSet" that you can find in Add New Item template (I
think that I got the spelling right, just confirmed it). A corresponding
..xsd file (<datasetname>.xsd) is auto-generated after a "DataSet" is ADDED
to the project. VS2005 auto-suggests to place the associated .xsd file in
App_Code folder (and not App_Data that I mistakenly used in my OP). VS2008
does not do that.
 
D

dan

I created a new project (i.e. web application) instead of new web site as I
used to in VS2005. I was happy to see the model back (i.e. like in VS2003).
Thanks for bringing it up. Do you think that could've made a difference?
I'll try web site later today.
Do you know if best practices are different for web applications? Any links
that deal with the subject?
Thanks
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top