Solved

Help overriding tableadapter connection string in c#

Posted on 2007-03-26
5
1,298 Views
Last Modified: 2012-05-05
I am trying to override the default connection string in a table adapter with a string that gets built using the connectionstringbuilder

            SqlConnection c = ConnStrBuilder.BuildConnection(orgid);
            tvEventLocationsPlusNamesTableAdapter tvELNByEventAdapt = new tvEventLocationsPlusNamesTableAdapter();
            tvELNByEventAdapt.Connection = c;

This little snippet is what my current code is but it returns an error because the tvELNByEventAdapt doesnt contain a definition for 'Connection'.

What is  the correct way for me to override the default connection string for the table adapter so that its using the correct connection string?

0
Comment
Question by:Prysson
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 18798258
i think u will have to do

tvELNByEventAdapt.SelectCommand.Connection = c;

si,ilarly for inserte, update and delete commands
0
 

Author Comment

by:Prysson
ID: 18799122
THat just gives me the same error about not containing a definition.

0
 

Accepted Solution

by:
Prysson earned 0 total points
ID: 18799401
Never mind the problem was that the adapter was hosed. I recreated teh adapter and my code works fine now.

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now