spooflookymusssss
New Member
I am running a simple program in which you enter a user number into a text box, click the submit button, and then the program is supposed to go to a database look up the number you entered and display that rows information. Simple enough.The problem is I keep getting the error that Xml.XmlDataDocument() is obsolete. I've googled this issue, which led me to here, but the replacements suggested do not work within my program. Also, I have not studied VB and this is for an XML class. I've double checked my code for any errors and do not see anything. But, I could be missing the forest for the trees. Would like to have another set of eyes take a look at my code to see if I've missed something, or to offer up a replacement for the Xml.XmlDataDocument() line. Thank you in advance for any help you can offer.Here is the code I am using:Javascript for the onClick event\[code\]<script language="javascript" type="text/javascript"> function btnSearch_onclick() { var docSubmit = new ActiveXObject("MSXML2.DOMDocument"); docSubmit.loadXML("<?xml version='1.0'?><request><customerID>" + txtCustID.value + "</customerID></request>") var objSocket = new ActiveXObject("MSXML2.XMLHTTP"); objSocket.open("POST", "Lookup.aspx", false) objSocket.send(docSubmit) alert(objSocket.responseXML.xml) lblFirstName.innerHTML = objSocket.responseXML.selectSingleNode("//FirstName").firstChild.nodeValue lblLastName.innerHTML = objSocket.responseXML.selectSingleNode("//LastName").firstChild.nodeValue lblAddress.innerHTML = objSocket.responseXML.selectSingleNode("//Address").firstChild.nodeValue lblCity.innerHTML = objSocket.responseXML.selectSingleNode("//City").firstChild.nodeValue lblState.innerHTML = objSocket.responseXML.selectSingleNode("//State").firstChild.nodeValue lblZip.innerHTML = objSocket.responseXML.selectSingleNode("//Zip").firstChild.nodeValue } </script>\[/code\]And here is the VB code:\[code\]Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim docReceived As New System.Xml.XmlDataDocument() docReceived.Load(Request.InputStream) Dim CustomerID = docReceived.SelectSingleNode("//customerID").FirstChild.Value Dim myConnection As New System.Data.OleDb.OleDbConnection Dim myConnectionString As String myConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & _ Server.MapPath("customer.mbd") myConnection.ConnectionString = myConnectionString Dim strSQL As String strSQL = "Select * From CustomerInfo where CustomerID = " & CustomerID Dim myAdapter As New System.Data.OleDb.OleDbDataAdapter(strSQL, myConnection) Dim myDataSet As New System.Data.DataSet("CustomerInfo") Dim intRecords As Integer intRecords = myAdapter.Fill(myDataSet, "Customer") Response.ContentType = "text/xml" If intRecords > 0 Then myDataSet.WriteXml(Response.OutputStream) Else Response.Write("<?xml version='1.0'?><customer><FirstName>Not Found</FirstName><LastName>***</LastName><Address>***</Address><City>***</City><State>***</State><Zip>***</Zip><Phone>***</Phone><Email>***</Email></customer>") End If myDataSet.WriteXml(Response.OutputStream) myConnection.Close() myAdapter.Dispose() myConnection.Dispose() End Sub\[/code\]