jvcoach23
Well-known member
Im trying to write out the scheme to an xsd file so that I can use it in crystal cr. eventually im trying to have images show up.. based on the Crystal Reports .Net programming book page 372 and 3. I dont know much about xsd files.. but it doesnt look right.. was wondering if someone could take a look. here it the file
Ex:
the vcFileName looks to be in there twice.. was on the unbounded.
Here is what Im doing
I need to read the vcFileName from a database.. so I need to do that, but is that was is screwing up the xsd file.
hope someone is willing to explain
thanks
shannon
Ex:
Code:
<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Pic">
<xs:complexType>
<xs:sequence>
<xs:element name="vcFileName" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Image_x0020_Table">
<xs:complexType>
<xs:sequence>
<xs:element name="Image" type="xs:unsignedByte" minOccurs="0" />
<xs:element name="vcFileName" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
the vcFileName looks to be in there twice.. was on the unbounded.
Here is what Im doing
Code:
Dim cn As SqlConnection
Dim cm As New SqlCommand
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Dim dr As DataRow
Dim dt As DataTable
dt = New DataTable("Image Table")
Dim dc As DataColumn
dc = New DataColumn("Image", GetType(System.Byte))
dt.Columns.Add(dc)
dc = New DataColumn("vcFileName", GetType(System.String))
dt.Columns.Add(dc)
cn = New SqlConnection("pwd=pw; UID=id; server=(local); database=Shannon")
cm = New SqlCommand("select vcFileName from tblShannon", cn)
cm.CommandType = CommandType.Text
Try
cn.Open()
da.SelectCommand = cm
cn.Close()
Catch ex As Exception
Throw ex
End Try
da.Fill(ds, "Pic")
For Each dr In ds.Tables("Pic").Rows
Debug.WriteLine(dr.Item("vcFileName"))
dr = dt.NewRow
dr("vcFileName") = dr("vcFileName")
dt.Rows.Add(dr)
Next
ds.Tables.Add(dt)
only do this first time run report
ds.WriteXmlSchema("ImageTable.xsd")
hope someone is willing to explain
thanks
shannon