Last post Jan 03, 2012 07:59 AM by ony
Mar 21, 2007 04:27 AM|Heleboel|LINK
I am building a Web Application Project with Visual Studio 2005. On one page, I added a SqlDataSource with a connectionstring.
The problem is as follows: I get the warning "Generation of designer file failed: The expression prefix 'ConnectionStrings' was not recognized. Please correct the prefix or register the prefix in the <expressionBuilders> section of configuration."
My application runs well, but adding controls to this page does not update the .aspx.designer.cs code behind file.
Anyone who has a solution for this? I tried the <expressionBuilders> suggestion, but it did not work.
Thanks in advace.
Web Application Project
Mar 21, 2007 06:59 AM|aghausman12|LINK
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [Tbl_Project]"></asp:SqlDataSource>
Mar 23, 2007 04:03 PM|iCode|LINK
Apr 16, 2007 11:59 AM|mtscar|LINK
I had the same problem. When I would view the xxx.designer.vb file, any new controls added to the page would not get added to that file.
I completely removed the datasource, then re-added it and things went back to working correctly.
Apr 16, 2007 02:22 PM|mtscar|LINK
Nevermind. I worked until I made any code changes. I just put the connection string right in the markup page, and it works that way.
Sep 24, 2007 04:17 PM|mediademon|LINK
I've been getting this problem and i'm suprised how little info there is out there.
My sites are 1.1 conversions too and i've followed every suggestion i've been able to find with no luck.
Basically, yes you can use a connection string directly inline but with a lot of pages this becomes unmanageable.
It seems that the error:
Generation of designer file failed: The expression prefix “ConnectionStrings” was not recognized. Please correct the prefix or register the prefix in the <expressionBuilders> section of configuration.
stops the designer file from being modified with any new controls added. When this error is detected the whole designer generation process is stopped.
Anyone else had this and solved it as opposed to working around it?
Data Access connections
ASP .NET 2
Nov 30, 2007 04:01 PM|JoeBird99|LINK
We've been experiencing the same error on a project that has not been converted at all. Moreover, the issue popped up half way through development of the application and had previously been working fine.
Has anyone found any solutions?
Dec 01, 2007 05:55 AM|mediademon|LINK
I still haven't found a solution, i'm still not using connectionstrings in my datasources...
Dec 19, 2007 12:04 PM|ptleitch|LINK
Jan 31, 2008 08:51 AM|mediademon|LINK
Dec 18, 2008 11:34 AM|v_2geofs|LINK
Run a repair of your ASP.NET framework. The problem is that somehow your framework has become corrupted, so Visual Studio cannot recognize the controls.
Jan 03, 2012 07:57 AM|ony|LINK
I Tried This And It Just Worked Fine:
In aspx Page:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="select * from dbo.Customer"
<asp:DataGrid ID="dg1" runat="server" DataSourceID="SqlDataSource1" /><!--In Web.Config File:
<compilation debug="true" targetFramework="4.0"/>
<add name="NW" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Name\Documents\Visual Studio 2010\WebSites\Website1\App_Data\Database.mdf;Integrated Security=True;User Instance=True" />
-->Give it a Try It should work, atleast worked for me..Thanks.
Jan 03, 2012 07:59 AM|ony|LINK
Oops don't forget to remove '<!--' & '-->' in case you copy from above..