• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Codeaddict7423
#1 Posted : Thursday, April 16, 2009 9:52:13 AM(UTC)
Codeaddict7423

Rank: Member

Joined: 1/23/2009(UTC)
Posts: 71

Hello,


I am using Visual Studio 2005 to connect a new dropdown control to a table within the BVC5 database. I uploaded the edited file to the correct folder (BVCommerce/BVAdmin/Orders). When I do, I get a "connection string cannot be found" error message.



I've reviewed the web.config file and I see the connection string, I'm using the same connection string but can't somehow to the BVC5 database. ANY help with this proble would be greatly appreciated.
Codeaddict7423
#2 Posted : Thursday, April 16, 2009 10:55:38 AM(UTC)
Codeaddict7423

Rank: Member

Joined: 1/23/2009(UTC)
Posts: 71

Hello,

Hah!, I solved my own problem...

For anyone who wants to access data in tables in the BVC5 database, here's the trick. I'm using a dropdown control in Visual Studio 2005 to accomplish this.

Go to the page where you want to add this control or display data from a table in the BVC5 database. Drop a control, such as the Dropdownlist control. ie:
<asp:DropDownList ID="lstDropDownControlName" runat="server" AutoPostBack="True" DataSourceID="dsName" DataTextField="FieldName" DataValueField="FieldName">
</asp:DropDownList>
<asp:SqlDataSource ID="dsDataSourceName" runat="server" ConnectionString="<%$ConnectionStrings:Bvc5Database %>" SelectCommand="SELECT [FieldName] FROM [bvc_TableName] ORDER BY [FieldName]"></asp:SqlDataSource>

By referencing a ConnectionString=<%$ConnectrionStrings: Bvc5Database%>, this connection string is already in the web.config database and is already running. You just have to reference it (ie: tell BVC5 to use this connection string).

I hope this tidbit helps someone.

L
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012