|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
[VB.NET] How to store/load XML schema internally...Group,
I need to have my schemas loaded for a dataset, but can't have .xsd files in my finished program laying around for users to mess with. Is there a way to store the schema programmatically (preferably as data in classes in .dlls, or even simple strings), thus avoiding having to load them from the fs? TIA! pat Show quoteHide quote :) Cor,
Well, for one thing I need to avoid the overhead of a dataset infering the schema, as there will be a LOT of data sent to the dataset. Additionally, I need to enforce (validate?) the values coming in are interpretted correctly, as subsequent processes will depend on it. This all works fine from a file: dsTest.ReadXMLSchema("C:|someSchema.xsd") I'm trying to do it without external files of any kind (except for dlls, if that is how it needs to be done). TIA! pat Show quoteHide quote :) Pat,
You can make any dataset in code as the samples on our website are mostly done. http://www.vb-tips.com/default.aspx?ID=30d9d2fd-9f10-4928-b7c8-1def3152436f What you miss on our site is the lenght to be set that is possible with http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.maxlength(VS.80).aspx I hope this helps, Cor Cor,
I like the website you have. I am just learning how to use Datasets and DataViews more effectively, and I like your DataSet section! CMM, Your solution makes it sound simple! I'll try it out as soon as I can! Now I have hope! Thanks! pat Show quoteHide quote :) Add the xsd to your project and select its Build Action to "Embedded
Resource." This builds the file into the EXE (or DLL). You can pass it to ReadXmlSchema like this: ds.ReadXmlSchema(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MyApplication.MySchema.xsd")) Where MyApplication is the root namespace of your project. You can do this with all sorts of files... like text files, Word documents, RTF files, what have you. P.S. Alternatively, you should probably be converting your xsd's to "Typed Datasets." They have their schema "built-in." Show quoteHide quote "pat" <pat.trai***@gmail.com> wrote in message news:1142081716.215090.75610@u72g2000cwu.googlegroups.com... > Group, > > I need to have my schemas loaded for a dataset, but can't have .xsd > files in my finished program laying around for users to mess with. > > Is there a way to store the schema programmatically (preferably as data > in classes in .dlls, or even simple strings), thus avoiding having to > load them from the fs? > > TIA! > > pat > :) >
Application.Run Problem
Passing values bewteen user controls is separate web forms Best way to implement 2 controls on one window Newbee ASP.NET Questions Best value Help file builder Write to an existing ASCII file Can't Change Installation Drive for new install of Visual Studio Professional 2005 How to programmatically change directory attributes VB.NET 2.0 Simple data grid question |
|||||||||||||||||||||||