help. System.IO.IOException: The device is not ready

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine

Hi Folks,

I developed and web application using VB.net, in order to provide quick response to users selection for drop down. i used XML files to populate data in drop downs as per users selection. This form worked perfectly fine on my local machine.

But, when i uploaded files on server all aspx pages worked fine and even my first drop down was populated with the data from xml file, but when i selected the item from dropdown (on selectedindexchanged function) instead of populating second drop down i git this error.


Server Error in / Application.

The device is not ready.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.IOException: The device is not ready.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[IOException: The device is not ready.
]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +723
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) +888
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +45
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) +73
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +55
System.Xml.XmlTextReader.CreateScanner() +384
System.Xml.XmlTextReader.Init() +23
System.Xml.XmlTextReader.Read() +530
System.Xml.XmlValidatingReader.ReadWithCollectTextToken() +146
System.Xml.XmlValidatingReader.Read() +26
System.Xml.XPath.XPathDocument.Load(XmlReader reader) +116
System.Xml.XPath.XPathDocument.Init(XmlReader reader) +79
System.Xml.XPath.XPathDocument..ctor(String uri) +95
WebNewRel.frf.dropDown_Test_Cmb() in C:InetpubwwwrootWebNewRelrptfrf.aspx.vb:169
WebNewRel.frf.ProductNm_Cmb_SelectedIndexChanged(Object sender, EventArgs e) in C:InetpubwwwrootWebNewRelrptfrf.aspx.vb:115
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26
System.Web.UI.Page.RaiseChangedEvents() +115
System.Web.UI.Page.ProcessRequestMain() +1099


Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300



I am using web.config file to point xmlfiles and this is physical path of corporate server. (as you know first dropdown is populated fine, but when i select an item problem comes)
code and xml file for my form is below.

<add key="xml_ProdList" value="H:webXmlDataxml_ProdList.xml"/>

These XML file are samples of my files
<NewDataSet>
<XML_ACTION_TYPE>
<ACTION_TYPE>INFO</ACTION_TYPE>
</XML_ACTION_TYPE>
<XML_ACTION_TYPE>
<ACTION_TYPE>CCA</ACTION_TYPE>
</XML_ACTION_TYPE>
<XML_ACTION_TYPE>
<ACTION_TYPE>XI</ACTION_TYPE>
</XML_ACTION_TYPE>
<XML_ACTION_TYPE>
<ACTION_TYPE>IM</ACTION_TYPE>
</XML_ACTION_TYPE>

</NewDataSet>

file 2 <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!--Created at 31/10/2006 15:26:56-->
<root_node>
<XML_Child_Node>
<PRODUCT_NAME>product1</PRODUCT_NAME>
<TEST_NAME>test1</TEST_NAME>
<MACHINE_NO p_name="product1" t_name="test1" m_name="mc1 B28-01</MACHINE_NO>
</XML_Child_Node>
<XML_Child_Node>
<PRODUCT_NAME>prod2</PRODUCT_NAME>
<TEST_NAME>test2</TEST_NAME>
<MACHINE_NO p_name="prod2" t_name="test2" m_name="mc2 B28-02</MACHINE_NO>
</XML_Child_Node>
</root_node>
Private Sub ProductNm_Cmb_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProductNm_Cmb.SelectedIndexChanged
Me.Action_Type_cmb.Items.Clear() Me.Action_Type_cmb.Items.Add("") XMLdoc.Load(Me.xml_ActTypList) Dim RootNode As XmlElement = XMLdoc.DocumentElement Dim nodeList As XmlNodeList = RootNode.GetElementsByTagName("ACTION_TYPE")
Dim i As Integer For i = 0 To nodeList.Count - 1 Me.Action_Type_cmb.Items.Add(nodeList.Item(i).InnerXml) Next i
XMLdoc = Nothing
call test name dropdown to popullate with all the machine numbers
dropDown_Test_Cmb()
call machine no dropdown to popullate with all the machine numbers
dropDown_Machine_Cmb_FullList()
call software set
dropDown_Software_Cmb()
call PDT
dropDown_PDT_cmb()
End Sub Private Sub Test_Cmb_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Test_Cmb.SelectedIndexChanged Me.Machine_Cmb.Items.Clear() Me.Machine_Cmb.Items.Add("") Dim myXPathDocument2 As XPathDocument = New XPathDocument(xml_mcNoList) Dim myXPathNavigator2 As XPathNavigator = myXPathDocument2.CreateNavigator() Dim myXPathNodeIterator2 As XPathNodeIterator = myXPathNavigator2.Select("/root_node/XML_Child_Node/MACHINE_NO[@t_name=" & Me.Test_Cmb.SelectedValue & "] | /root_node/XML_Child_Node/MACHINE_NO[@t_name=" & Me.Test_Cmb.SelectedValue & "]") While (myXPathNodeIterator2.MoveNext())
If myXPathNodeIterator2.Current.Name = "MACHINE_NO" Then Me.Machine_Cmb.Items.Add(myXPathNodeIterator2.Current.Value)
End If
End While
call segment
dropDown_Segment_Cmb()
End Sub

Any help will be appreciated, Thanks in advance.

Regards

View the full article
 
Back
Top