Mike Eghtebas
asked on
Read Connection string from xml file vb.net
The project runs fine with Line 12 below. But, with lines 9 and 11 it fails.
Question: Why line 9 is not reading the connection string? Is shows "nothing" via intelesens.
Question: Why line 9 is not reading the connection string? Is shows "nothing" via intelesens.
<?xml version="1.0" encoding="utf-8" ?>
<connection>
Data Source=.\SQLEXPRESS12;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True;User Instance=True
</connection>
Protected Shared Function GetNWConString() As String
Dim xmlReader As New XmlTextReader("csNorthwind.xml")
Return xmlReader.ReadElementString("connection")
'Return "Data Source=.\SQLEXPRESS12;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True;User Instance=True"
End Function
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
When I checked "Copy to Output Directory" I notice it was on "Do not Copy".
ASKER
I have typed it manually. I am not aware of utility that builds xml file like this.
Mike