| | |
database string in web.config not working
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2005
Posts: 1
Reputation:
Solved Threads: 0
hello, i just started to code aspx, but i found troubles adding the connection string in the web.config
i was trying to code the "populate the listbox" tutorial, and in the part of pasting the connection string in the above mentioned file, i'm getting this error
"Only elements allowed"
The debug points to that line in the web.config
Thanks in advance, this web is cool because the tutorials are so well explained, which is hard to find on other sites for noobies like me.
thanks thanks thanks !
i was trying to code the "populate the listbox" tutorial, and in the part of pasting the connection string in the above mentioned file, i'm getting this error
"Only elements allowed"
The debug points to that line in the web.config
Thanks in advance, this web is cool because the tutorials are so well explained, which is hard to find on other sites for noobies like me.
thanks thanks thanks !
•
•
Join Date: Apr 2005
Posts: 18
Reputation:
Solved Threads: 2
Here might be one solution to help you out. This is not my work I found it elsewhere.
Hope this helps.
Miller
ASP.NET Syntax (Toggle Plain Text)
In the web.config file, add the following section <configuration> <appSettings file="app.config"></appSettings> </configuration> In a new file, add the following and save it as app.cfg <?xml version="1.0" encoding="utf-8" ?> <appSettings> <add key="conn" value="Data Source=localhost;Integrated Security=SSPI; database=YourDB" /> </appSettings>
Hope this helps.
Miller
•
•
Join Date: Apr 2007
Posts: 1
Reputation:
Solved Threads: 0
I know the original poster has probably long since solved their problem, but I thought I'd answer for anyone coming along after who faces a similar exception and is confused. Especially since both of the original replies above are either wrong or comment spam.
Now, what this exception generally means is that the XML in the App.Config file is ill-formed. That is, you have probably put something in there that shouldn't be there or something like that. For instance, when I got this error recently, it was because I had accidently put a semi-colon at the end of a key.
I'm not saying this is going to be the answer all the time, but if you get this sort of error, the first thing I would do is go back and check my App.Config file to ensure that you haven't thrown in an extra punctuation mark or the like. Good luck!
Now, what this exception generally means is that the XML in the App.Config file is ill-formed. That is, you have probably put something in there that shouldn't be there or something like that. For instance, when I got this error recently, it was because I had accidently put a semi-colon at the end of a key.
I'm not saying this is going to be the answer all the time, but if you get this sort of error, the first thing I would do is go back and check my App.Config file to ensure that you haven't thrown in an extra punctuation mark or the like. Good luck!
Last edited by webbsk; Apr 30th, 2007 at 4:20 pm.
![]() |
Similar Threads
- setting the web.config file (ASP.NET)
- urgent: session timeout occurs unexpectedly(given both web.config & global.asax code) (ASP.NET)
- wat is web.config (ASP)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- ADO.NET Specified cast is not valid (ASP.NET)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Problems with loading blackplanet.com
- Next Thread: Create control at runtime
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net box browser button c# c#gridviewcolumn checkbox click commonfunctions compatible confirmationcodegeneration content contenttype courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit expose fileuploader fill flash formatdecimal forms formview gridview gudi homeedition iframe iis javascript jquery listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols radio ratings redirect registration relationaldatabases reportemail rotatepage save schoolproject search security serializesmo.table silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers





