Hi,
I am reading the book and doing the the try it out as described everything is looking fine and suddenly my program responded abruptly. I downloaded the code and it is working fine but my code which I wrote which samne as the code I downloaded not working I am sending all the files. Below
Comments.xml file
<?xml version="1.0" encoding="utf-8" ?>
<Reviews>
<Review>
<ReviewID>1</ReviewID>
<ProductName>Chai</ProductName>
<EmployeeID>6</EmployeeID>
<Date>2001-01-01</Date>
<Comment>"Even tastier my mother's"</Comment>
</Review>
<Review>
<ReviewID>2</ReviewID>
<ProductName>Chang</ProductName>
<EmployeeID>7</EmployeeID>
<Date>2002-02-02</Date>
<Comment>""Reminds me of my childhood school lunch"</Comment>
</Review>
<Review>
<ReviewID>3</ReviewID>
<ProductName>Aniseed Syrup</ProductName>
<EmployeeID>8</EmployeeID>
<Date>2003-03-03</Date>
<Comment>"Gave me the courage to enlist in the Navy"</Comment>
</Review>
<Review>
<ReviewID>4</ReviewID>
<ProductName>Chai</ProductName>
<EmployeeID>8</EmployeeID>
<Date>2003-03-03</Date>
<Comment>"Of questionable taste"</Comment>
</Review>
</Reviews>
Comments.xsd File
<?xml version="1.0" standalone="yes" ?>
<schema xmlns="http://ww3.w3.org/2001/XMLSchema">
<element name="Reviews">
<complexType>
<choice maxOccurs="unbounded">
<element name="Review">
<complexType>
<sequence>
<element name="ReviewID" type="int" />
<element name="ProductName" type="string" />
<element name="EmployeeID" type="int" />
<element name="Date" type="date" />
<element name="Comment" type="string" />
</sequence>
</complexType>
</element>
</choice>
</complexType>
</element>
</schema>
main file DisplayColumnInfo.aspx
<%@ Page Language="
VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
'Connection
Dim strConnection As String = ConfigurationSettings.AppSettings("NWind")
Dim objConnection As New SqlConnection(strConnection)
'Sql Statement Setup
Dim strSqlProducts As String = "Select ProductID, ProductName From Products "
strSqlProducts &= "WHERE ProductID < 5 ORDER BY ProductID;"
'Create DataSet and DataAdapter with properties that apply to all tables
Dim objDataSet As New DataSet("ProductPage")
Dim objAdapter As New SqlDataAdapter(strSqlProducts, objConnection)
'First Table - "Comments Table" From XML
objDataSet.ReadXmlSchema(Server.MapPath("Comments. xsd"))
objDataSet.ReadXml(Server.MapPath("Comments.xml"))
'Second Table - "Products Table" From Northwind
objAdapter.Fill(objDataSet, "dtProducts")
'Dignostic Print of tables in objDataset - loop through DataSet.Tables
Dim strNames As String
Dim c As DataColumn
Dim iTableItem As DataTable
For Each iTableItem In objDataSet.Tables
strNames &= "Table Name: " & iTableItem.tableName & "<br/>"
For Each c In iTableItem.Columns
strNames &= "- Column " & c.ColumnName & " is of type " _
& c.DataType.ToString & "<br/>"
Next
Next
Response.Write(strNames)
End Sub
</script>
<html>
<head>
<title>Display Column Information</title>
</head>
<body>
<form runat="server">
</form>
</body>
</html>
Please help
Thanks
Mahir Ali Ahmed
Mahir Ali Ahmed