Michael Palmer
I'm trying to reduce the amount of files to deploy. I'd prefer the schema
files be embedded. This is not for a web app, but rather a client/server
application, so I'd prefer to not have a directory full of 30-40 schema
files available to the user's prying eyes. I'm not dead-set on this method,
so if you have a better idea I'd definitely like to hear it. As far as
adding multiple views/schemas to the same file, if that is what you
proposed, I was not aware this was an option. VS.NET doesn't seem to let me
do it within the IDE. Besides the average schema in this project is 80-100
lines with some extending over 300, so if I combined them all into one file
I'd have one big mess of text, don't you think?
P.S.
Thanks for your inquiry, this question has been haunting me a bit. I'd love
to get a fresh perspective.
-Michael
"Mark W" <anonymous@discussions.microsoft.com> wrote in message
news:10A2227B-A59C-43DD-B14D-A54E8DEB1FA9@microsoft.com...[color=blue]
> I don't have an answer, but I'm curious as to why you want to do it? The[/color]
file is supposed to represent a static view of the database schema. If you
want another view, you just add it to the file. I believe the file is
cached, so there is no performance advantage.[color=blue]
>
> ----- Michael Palmer wrote: -----
>
> I'm reading xml from SQL Server 2K with VB.net using an XSD schema[/color]
file[color=blue]
> and SQLXML 3.0. I have the below code working fine, but I'd like to[/color]
change[color=blue]
> the code from reading the schema file from a directory to reading the
> schema as an embedded resource. Here's my current code, what would I[/color]
need[color=blue]
> to change??
>
> Dim strm As Stream
> Dim strmReader As StreamReader
> Dim cmd As New SqlXmlCommand("MyConnectionString")
> Dim xmlDoc As New XmlDocument
> Dim strXML As String
>
> With cmd
> .CommandText = "MyXPath"
> .CommandType = SqlXmlCommandType.XPath
> .SchemaPath = "C:\MySchemaFile.xsd" '**I want this to be[/color]
embedded,[color=blue]
> instead of pulled out of a directory**
> strm = .ExecuteStream
> End With
>
> strmReader = New StreamReader(strm)
> strXML = strmReader.ReadToEnd
> xmlDoc.LoadXml(strXML)
>
> I know how to access embedded resources and fill a stream using[/color]
reflection[color=blue]
> but I can't get SQLXMLCommand to accept the resulting in-memory XSD[/color]
schema[color=blue]
> and produce the same results as the above code produces. It seems the[/color]
only[color=blue]
> way to accomplish this is by using SchemaPath which only accepts a
> directory path.
>
> Any ideas?
>
>
>[/color] |