The connection name 'ASPNETDBConnectionString1' was not found in the applications configuration or the connection string is empty.
I had check the connection String I configure in the web.config file and it also have the same connectionstringname "ASPNETDBConnectionString1'. " both the connectionstring name in the source code and web config file has the same name.
here is the error msg : (error on line 234)
Line 232:
Line 233:
Line 234: <asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
Line 235: InsertCommand="INSERT INTO [Customer] ([UserId], [custName], [custNum], [dob], [custBillAddr], [custShipAddr]) VALUES (@UserId, @custName, @custNum, @dob, @custBillAddr, @custShipAddr)"
Line 236: ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>">
mathidioticz
Member
1 Points
25 Posts
The connection name 'ASPNETDBConnectionString1' was not found in the applications configuration o...
Dec 01, 2012 08:24 AM|LINK
Hi,
I encountered this error :
<asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" InsertCommand="INSERT INTO [Customer] ([UserId], [custName], [custNum], [dob], [custBillAddr], [custShipAddr]) VALUES (@UserId, @custName, @custNum, @dob, @custBillAddr, @custShipAddr)" ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>"> <InsertParameters> <asp:ControlParameter Name="custName" Type="String" ControlID="custName" PropertyName="Text" /> <asp:ControlParameter Name="custNum" Type="String" ControlID="custNum" PropertyName="Text" /> <asp:ControlParameter Name="dob" Type="String" ControlID="dob" PropertyName="Text" /> <asp:ControlParameter Name="custBillAddr" Type="String" ControlID="custBillAddr" PropertyName="Text" /> <asp:ControlParameter Name="custShipAddr" Type="String" ControlID="custBAddr" PropertyName="Text" /> </InsertParameters> </asp:SqlDataSource><configuration> <connectionStrings> <add name="ASPNETDBConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> <add name="WholesaleConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\WholesaleDB.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> <add name="iWineDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\June\Desktop\IT2693(ITIPJ)\iWine\App_Data\iWineDB.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> <add name="InternationalConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\June\Desktop\IT2693(ITIPJ)\InternationalWineDealer\App_Data\InternationalDB.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <membership defaultProvider="ASPNETDBConnectionString1"> </membership> <compilation debug="false" targetFramework="4.0"> <assemblies> <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> </assemblies> </compilation> </system.web> <system.web> <httpHandlers> <add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" /> </httpHandlers> </system.web> </configuration>Angie xu - M...
All-Star
20240 Points
1717 Posts
Microsoft
Re: The connection name 'ASPNETDBConnectionString1' was not found in the applications configurati...
Dec 10, 2012 06:04 AM|LINK
Hi mathidioticz
Please refer this about How To: Connect to SQL Server Using SQL Authentication in ASP.NET 2.0,
and check the steps to learn Configure a Connection String, Encrypt the Connection String, Configure SQL Server Security and so on.
http://msdn.microsoft.com/en-us/library/ff648340.aspx
Kind regards
Feedback to us
Develop and promote your apps in Windows Store