This post is to do with how VS'05/ASP.NET handles the DataSet and connection strings.
Today, I got the following error:
Error 39 Unable to convert input xml file content to a DataSet. Requested value 'ConnectionStrings' was not found.
The reason for this error was that I had named my ConnectionString JN.ConnectionString. Now looking at it, this seems a pretty normal name, however a problem arises because of the "." within that string's name. Apparently in the Connection element of the DataSet1.xsd (ie the DataSet file), mistakes the "." to mean something it shouldn't and thus generates the error I mentioned above. (More specifically it's this line: 'PropertyReference="...ConnectionStrings.JN.ConnectionString.ConnectionString"' - I show the problem in bold,red,underlined).
To fix this and also ensure that you never have the error mentioned, make it a RULE NEVER to include a "." (dot/full stop) in your connectionstring's name. So you'll have: 'name="JNConnectionString"' in your web.config and 'PropertyReference="...ConnectionStrings.JNConnectionString.ConnectionString"' in your DataSet1.xsd file.
(By the way, I didn't find this error on Google, so apparently it's only me that make this mistake. )
tagged: professional // Comments [0]
Related posts:Select a random row in MS SQL...Regular expressionsVS2005, ASP.NET 2 & DLLs, DLLs..MS's ASP.NET and.. PHP2-way databinding cascading drop down lists within a FormViewApplicationName Property when customising providers
Disclaimer The posts on this blog are provided "AS IS" with no warranties. The opinions expressed herein are my own personal opinions and do not represent any other person's views in anyway.