list xml files residing in server

Author Topic
saurabh thakur
Member

Joined: 09 Jan 2009
Country: India
Posts: 1

Posted: 09 Jan 2009 14:38:57

hello,
i am using .net 1.1,vb ,i have 2 web applications.one is installed in client side server which is currently working offline(intranet)..other is at my side which is online website.frequently i have to give master data to client .So using httprequest and xml , i am giving him data.I have given one option to client side application from where he connects to online application and fetches the data.
now the problem is that he is asking for previous xml files also
so i have to display him the list of xml files in a listbox from where he can choose any file and retrive the data to sql database..
I am using following code for fetching one file at a time :

Dim objResponse As HttpWebResponse
Dim Myuri As New Uri("website/xxx.xxx.xxx.xxx/files/xmlfile.xml")
Dim objRequest As WebRequest = WebRequest.Create(Myuri)
Dim objStreamReader As StreamReader
Dim SB As New StringBuilder
dim ds as new dataset
dim dt as new datatable
Dim XW As New XmlTextWriter(New StringWriter(S)

objResponse = CType(objRequest.GetResponse, HttpWebResponse)

objStreamReader = New StreamReader(objResponse.GetResponseStream())

Dim xmlRepDoc As New XmlDocument
xmlRepDoc.Load(objStreamReader)

xmlRepDoc.WriteTo(XW)
XW.Close()
ds.ReadXml(New StringReader(SB.ToString))
dt = ds.Tables(0)


hello,
i am using .net 1.1,vb ,i have 2 web applications.one is installed in client side server which is currently working offline(intranet)..other is at my side which is online website.frequently i have to give master data to client .So using httprequest and xml , i am giving him data.I have given one option to client side application from where he connects to online application and fetches the data.
now the problem is that he is asking for previous xml files also
so i have to display him the list of xml files in a listbox from where he can choose any file and retrive the data to sql database..
I am using following code for fetching one file at a time :

Dim objResponse As HttpWebResponse
Dim Myuri As New Uri("website/xxx.xxx.xxx.xxx/files/xmlfile.xml")
Dim objRequest As WebRequest = WebRequest.Create(Myuri)
Dim objStreamReader As StreamReader
Dim SB As New StringBuilder
dim ds as new dataset
dim dt as new datatable
Dim XW As New XmlTextWriter(New StringWriter(S)

objResponse = CType(objRequest.GetResponse, HttpWebResponse)

objStreamReader = New StreamReader(objResponse.GetResponseStream())

Dim xmlRepDoc As New XmlDocument
xmlRepDoc.Load(objStreamReader)

xmlRepDoc.WriteTo(XW)
XW.Close()
ds.ReadXml(New StringReader(SB.ToString))
dt = ds.Tables(0)


Ben Afflek
Member

Joined: 03 Jun 2010
Homepage: link
Country: US
Posts: 1

Posted: 03 Jun 2010 20:45:31

Thanks for sharing. I can suggest php tutorial in this case.

Thanks for sharing. I can suggest php tutorial in this case.

Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency