Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

VS2008: should data sets be placed in App_Data?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dan - 19 Mar 2008 20:00 GMT
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.
Juan T. Llibre - 19 Mar 2008 20:05 GMT
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.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> 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.
dan - 19 Mar 2008 20:45 GMT
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).

> Datasets are usually stored in memory, as an in-memory database.
>
[quoted text clipped - 14 lines]
>> practice is?
>> Thanks.
Patrice - 19 Mar 2008 20:11 GMT
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) ???

--
Patrice

> 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
[quoted text clipped - 5 lines]
> practice is?
> Thanks.
dan - 19 Mar 2008 20:42 GMT
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.

> Try to add them from the main menu. It should suggest to add them in
> App_Code...
[quoted text clipped - 14 lines]
>> practice is?
>> Thanks.
Juan T. Llibre - 20 Mar 2008 10:42 GMT
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."

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> 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.

>> Try to add them from the main menu. It should suggest to add them in App_Code...
>>
[quoted text clipped - 9 lines]
>>> Does anyone know what is behind the change and what the recommended practice is?
>>> Thanks.
dan - 20 Mar 2008 14:41 GMT
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.

> re:
> !> DataSets (i.e. xsd)
[quoted text clipped - 47 lines]
>>>> practice is?
>>>> Thanks.
Patrice - 20 Mar 2008 11:24 GMT
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 ?)

--
Patrice

> 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
[quoted text clipped - 24 lines]
>>> practice is?
>>> Thanks.
dan - 20 Mar 2008 14:51 GMT
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

> 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
[quoted text clipped - 31 lines]
>>>> practice is?
>>>> Thanks.
dan - 20 Mar 2008 14:30 GMT
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.

> Try to add them from the main menu. It should suggest to add them in
> App_Code...
[quoted text clipped - 14 lines]
>> practice is?
>> Thanks.
Eliyahu Goldin - 20 Mar 2008 10:16 GMT
App_Data is for data, like databases, and data files. Dataset is a class. It
has no place in App_Data.

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

> 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
[quoted text clipped - 5 lines]
> practice is?
> Thanks.
dan - 20 Mar 2008 14:25 GMT
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.

> 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
[quoted text clipped - 5 lines]
> practice is?
> Thanks.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.