Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Place dataset in a separate folder?
Message
De
16/10/2013 13:15:37
 
 
À
16/10/2013 13:13:36
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01585466
Message ID:
01585667
Vues:
25
>>>>>>>>>>>I am thinking of how better organize some files in the ASP.NET 4.0 project. The project will use datasets (xsd) files. So my questions are:
>>>>>>>>>>>1. Will I have to copy the .xsd file to the customer server when deploying the application?
>>>>>>>>>>>2. Is it a good idea to create a separate folder for all DataSets (xsd) that will be used in the project?
>>>>>>>>>>>TIA
>>>>>>>>>>
>>>>>>>>>>I created a folder (in the application folder of VS 2012) Data_sets (so my directory tree is now App_Name\Data_Sets. Then I copy dataset file MyDataSet.xsd to the folder Data_Sets. Then I add an existing item (Data Set) to the Project. So in the VS tree I see the folder Data_sets and the dataset MyDataSet. But how do I use this dataset in the code? For example, the following does not work:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>MyDataSet dstMyData;
>>>>>>>>>>// VS does not find MyDataSet
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>How do I refer in the code that the dataset is not in the application root folder but in the sub-folder?
>>>>>>>>>
>>>>>>>>>IIRC when you create any file in a sub-folder then, by default, the folder name is appended to the namespace so in your case the Dataset namespace would be ......Data_sets.MyDataSet. If you don't want that to happen then, after creating the folder open its Properties window and set 'NameSpaceProvider' to false.
>>>>>>>>
>>>>>>>>Thank you for the explanation and how to make NameSpace not necessary.
>>>>>>>
>>>>>>>I would still use the namespaces - if you don't you'll end up with a mess
>>>>>>
>>>>>>I must confess to dithering on this issue. As mentioned to Dmitry the option to set NameSpaceProvider to false wasn't there in early versions of VS so there must be a lot of solutions out there that follow that convention. OTOH I remember being annoyed since I sometimes wanted to group things of a similar type under a sub-folder structure and *not* clutter up the final solution with a lot of namespaces that serve no real purpose....
>>>>>
>>>>>
>>>>>Done that as well - keep stuff in a subfolder and change the namespace of each item to the namespace of the parent folder
>>>>>
>>>>>But in general - The items in a subfolder have a different namespace
>>>>>
>>>>>It depends. A namespace is both a blessing (same names are possible) and a curse (if you go too deep)
>>>>>
>>>>>There are times that the namespace does not completely follow the folder hierarchy
>>>>
>>>>The most flexible solution would be to allow the namespace for the folder to be specified explicitly - but that could lead to even more confusion :-{
>>>
>>>
>>>Off topic but still an interesting link I received today http://en.wikipedia.org/wiki/Monty_Hall_problem
>>>[ not to be read after returning from the pub ]
>>
>>Oddly enough I came across that the other day. IIRC it always pays to switch ?
>>Ha - here 'tis : http://www.bbc.co.uk/news/magazine-24045598
>
>
>Yes, it always pays to switch. Took some time before I understood

Just watched that clip again - pretty convincing one-off test.....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform