Advertisement

03.17.2008 at 05:36AM PDT, ID: 23246761
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

How to set connectionstring for LINQ dataaccess in markup?

Tags: C#, ASP.NET, LINQ, IE, FireFox, Opera, LINQ, Markup, SQL, C#, .NET
Hi,

I am using LINQ to SQL, and one thing I don't like about it, is that it automatically adds connectionstring to my .config file and use a connection string key in the generated code, since I already have a connectionstring that I am using.

When I use the datacontext object in my C# code, its okay because then I add the connectionstring as a constructor parameter. Like this:
CargoInventoryDataContext cid = new CargoInventoryDataContext(WebConfigurationManager.ConnectionStrings["IMS"].ConnectionString);

But when I only use the datacontext object in my .aspx file/markup, how do I then specify the connectionstring key to use in the markup???

This is how my markup for LINQ looks like:

<asp:LinqDataSource ID="ManuallyRegisteredTag_LinqDataSource" runat="server"  
                                        ContextTypeName="ManualDataIdDataContext"   TableName="ManualRegisteredTags"
                                        Select="new (TagId, TagName)" Where="ManualRegistration == @ManualRegistration AND ApplicationId == @ApplicationId">
                        <WhereParameters>
                            <asp:Parameter Name="ManualRegistration" Type="Boolean" DefaultValue="true" />
                            <asp:Parameter Name="ApplicationId" Type="Int32" DefaultValue="13" />
                        </WhereParameters>
     
                    </asp:LinqDataSource>

Tnx :)
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: kimfink
Solution Provided By: sjturner2
Participating Experts: 2
Solution Grade: B
Views: 14
Translate:
Loading Advertisement...
03.25.2008 at 05:25AM PDT, ID: 21201170

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.06.2008 at 02:11PM PDT, ID: 21511123

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628