473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

URI Formats are not supported

Using the following code I am trying to save changes to a xml from a VB.Net
app.
' Save the changes to the config file.
Dim xmlDoc As New XmlDocument
Dim strAppWorkingDir As String =
Path.GetDirectoryName([Assembly].GetExecutingAssembly.GetName.CodeBase) &
"\Config.xml"

xmlDoc.Load(strAppWorkingDir)
xmlDoc.GetElementsByTagName("Server").ItemOf(0).In nerXml =
txtServer.Text
xmlDoc.GetElementsByTagName("Database").ItemOf(0). InnerXml =
txtDatabase.Text
xmlDoc.GetElementsByTagName("UserName").ItemOf(0). InnerXml =
txtUserName.Text
xmlDoc.GetElementsByTagName("Password").ItemOf(0). InnerXml =
txtPassword.Text
xmlDoc.GetElementsByTagName("TimeOut").ItemOf(0).I nnerXml =
txtTimeOut.Text
xmlDoc.GetElementsByTagName("Timer").ItemOf(0).Inn erXml =
txtTimer.Text

Try
xmlDoc.Save(strAppWorkingDir)
Catch ex As Exception
MessageBox.Show(ex.Message)
Exit Function
End Try

MessageBox.Show("Settings Saved")

When the code hits the Save line I get this error message: URI formats are
not supported

Here is what the config file looks like:
<?xml version="1.0" encoding="utf-8" ?>

<Configuration>

<UserName>sa</UserName>

<Password>1234</Password>

<Database>Application</Database>

<Server>SQL</Server>

<TimeOut>30</TimeOut>

<Timer>5</Timer>

</Configuration>

What does this mean and how can I fix this problem?

Thanks,
Lou
Nov 21 '05 #1
4 9672
"Lou Civitella" <lo*@webersystems.com> schrieb:
' Save the changes to the config file.
Dim xmlDoc As New XmlDocument
Dim strAppWorkingDir As String =
Path.GetDirectoryName([Assembly].GetExecutingAssembly.GetName.CodeBase) &
"\Config.xml"

xmlDoc.Load(strAppWorkingDir)
xmlDoc.GetElementsByTagName("Server").ItemOf(0).In nerXml =
txtServer.Text
xmlDoc.GetElementsByTagName("Database").ItemOf(0). InnerXml =
txtDatabase.Text
xmlDoc.GetElementsByTagName("UserName").ItemOf(0). InnerXml =
txtUserName.Text
xmlDoc.GetElementsByTagName("Password").ItemOf(0). InnerXml =
txtPassword.Text
xmlDoc.GetElementsByTagName("TimeOut").ItemOf(0).I nnerXml =
txtTimeOut.Text
xmlDoc.GetElementsByTagName("Timer").ItemOf(0).Inn erXml =
txtTimer.Text

Try
xmlDoc.Save(strAppWorkingDir)
Catch ex As Exception
MessageBox.Show(ex.Message)
Exit Function
End Try

MessageBox.Show("Settings Saved")

When the code hits the Save line I get this error message: URI formats are
not supported


Can you post the value of 'strAppWorkingDir'?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
Here is the path it is returning.
file:\C:\Documents and Settings\Administrator\My Documents\Visual Studio
Projects\FTP\FTP\bin\Config.xml

Thanks Again,
Lou

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uL**************@TK2MSFTNGP14.phx.gbl...
"Lou Civitella" <lo*@webersystems.com> schrieb:
' Save the changes to the config file.
Dim xmlDoc As New XmlDocument
Dim strAppWorkingDir As String =
Path.GetDirectoryName([Assembly].GetExecutingAssembly.GetName.CodeBase) & "\Config.xml"

xmlDoc.Load(strAppWorkingDir)
xmlDoc.GetElementsByTagName("Server").ItemOf(0).In nerXml =
txtServer.Text
xmlDoc.GetElementsByTagName("Database").ItemOf(0). InnerXml =
txtDatabase.Text
xmlDoc.GetElementsByTagName("UserName").ItemOf(0). InnerXml =
txtUserName.Text
xmlDoc.GetElementsByTagName("Password").ItemOf(0). InnerXml =
txtPassword.Text
xmlDoc.GetElementsByTagName("TimeOut").ItemOf(0).I nnerXml =
txtTimeOut.Text
xmlDoc.GetElementsByTagName("Timer").ItemOf(0).Inn erXml =
txtTimer.Text

Try
xmlDoc.Save(strAppWorkingDir)
Catch ex As Exception
MessageBox.Show(ex.Message)
Exit Function
End Try

MessageBox.Show("Settings Saved")

When the code hits the Save line I get this error message: URI formats are not supported


Can you post the value of 'strAppWorkingDir'?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
"Lou Civitella" <lo*@webersystems.com> schrieb:
Here is the path it is returning.
file:\C:\Documents and Settings\Administrator\My Documents\Visual Studio
Projects\FTP\FTP\bin\Config.xml


Either remove the "file:\" prefix or use this code:

\\\
Imports System.IO
Imports System.Reflection
..
..
..
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4
Thanks a lot Herfried I added this code that you gave me and it worked
great.
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)

Thanks Again,
Lou

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
"Lou Civitella" <lo*@webersystems.com> schrieb:
Here is the path it is returning.
file:\C:\Documents and Settings\Administrator\My Documents\Visual Studio
Projects\FTP\FTP\bin\Config.xml


Either remove the "file:\" prefix or use this code:

\\\
Imports System.IO
Imports System.Reflection
.
.
.
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: K riley | last post by:
Hi. I am trying to use the XslTranfrom object and I am getting an unhandled expection. URI formats are not supported Exception Details: System.ArgumentException: URI formats are not supported....
2
by: thedebugger | last post by:
Dear Friends, I am making one RSS News Reader Desktop application in c#. Where I will show the images from website. I am generating xml file on server. like http://www.zeetelevision.com/myxml.xml...
2
by: Mark Jerde | last post by:
(If these are the wrong groups please suggest the right one(s). Thanks.) I need to come up with a way to test potentially thousands of data (files / records / streams) to determine if they match...
1
by: VB Programmer | last post by:
On this line of code: objStreamReader = File.OpenText(FILENAME) I get this error: URI formats are not supported. Description: An unhandled exception occurred during the execution of the...
4
by: Sam | last post by:
Hi, I've already asked a kind of question like that, but it's a bit different this time. How can I get all of the supported numeric formats by Windows? I want to fill a combobox with those...
0
by: Anil Gupte | last post by:
I am using an Image Button from Microsoft's Power Pack. When I use the ..Enabled=True/False I get the following error "SetPixel is not supported for images with indexed pixel formats" I am...
2
by: Mel | last post by:
I am getting this error when I try to declare an object as an Excel workbook. Can anyone tell me how to fix it? I have placed the Excel file on the server in the "spreadsheets" directory. ...
2
by: Peter Oliphant | last post by:
The Image class allows loading a bitmap from a graphic file. So far I've gotten it to work with JPG and BMP files. What other graphic file formats are supported in this way? Is this fixed based...
0
by: Sameera | last post by:
Hi, Could any one help me out on how to retriveing the supported formats for the installed Word version in C#. Thanks
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.