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" <an*******@disc ussions.microso ft.com> wrote in message
news:10******** *************** ***********@mic rosoft.com...
I don't have an answer, but I'm curious as to why you want to do it? The
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.
----- Michael Palmer wrote: -----
I'm reading xml from SQL Server 2K with VB.net using an XSD schema
file and SQLXML 3.0. I have the below code working fine, but I'd like to
change 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
need to change??
Dim strm As Stream
Dim strmReader As StreamReader
Dim cmd As New SqlXmlCommand(" MyConnectionStr ing")
Dim xmlDoc As New XmlDocument
Dim strXML As String
With cmd
.CommandText = "MyXPath"
.CommandType = SqlXmlCommandTy pe.XPath
.SchemaPath = "C:\MySchemaFil e.xsd" '**I want this to be
embedded, instead of pulled out of a directory**
strm = .ExecuteStream
End With
strmReader = New StreamReader(st rm)
strXML = strmReader.Read ToEnd
xmlDoc.LoadXml( strXML)
I know how to access embedded resources and fill a stream using
reflection but I can't get SQLXMLCommand to accept the resulting in-memory XSD
schema and produce the same results as the above code produces. It seems the
only way to accomplish this is by using SchemaPath which only accepts a
directory path.
Any ideas?