Solved

[VB 2013] Tableadapter Connectionstring

Posted on 2014-09-10
3
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 42

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 42

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio Debugging 3 153
Access 2013: API code to put hidden database icon in taskbar? 8 98
Post a good COM tutorial 1 68
Please explain purpose of GZIP 4 59
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
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…

749 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