Solved

[VB 2013] Tableadapter Connectionstring

Posted on 2014-09-10
3
155 Views
Last Modified: 2014-10-10
I have the following problem:

I have a Visual Studio (VB) 2013 project with a datasource. This datasource contains one table.
The project contains two connection strings(conOne and conTwo). I changed the connectionstring (manually in the properties) of the tableadapter to conTwo.

When I start the program the connectionstring it use always conOne.
In this code, it prints always conOne.
 
Dim tba As New dsTableAdapters.tbaTest
        MsgBox(tba.Connection.Database)
        MsgBox(tba.Connection.ToString)

Open in new window


In the properties of the tableadapter it is connection Two.

Please help me. It is very important for us. We use also VS 2008 at this moment and we don't have this problem in 2008.
Anyone know a solution for this problem?
0
Comment
Question by:Program1981
  • 2
3 Comments
 
LVL 41

Expert Comment

by:pcelba
ID: 40315758
Remove the conOne from the project, save the project, rebuild it, and try again. You should see where the conOne was used and then you may replace it by conTwo.
0
 

Author Comment

by:Program1981
ID: 40351603
Yes I did that, it works for a small time.

I have another project with the same problem. No I set all the tableadapter connection strings on each page. It's a solution, but not a good solution.
0
 
LVL 41

Accepted Solution

by:
pcelba earned 500 total points
ID: 40351618
You should connect to your data at one place (one data adapter class) in your code. All other modules/classes should call/instantiate this one data adapter class and problems are gone.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

17 Experts available now in Live!

Get 1:1 Help Now