How do I specify two different providerNames in VB project

Torquinian 21 Reputation points
2025-06-02T08:27:05.14+00:00

I am using VS2022 and VB.

I have a Windows Forms project that currently uses providerName=System.Data.sqlclient.

I want to gradually move away from sqlclient to odbc, and my idea is to do it one Windows Form at a time as I will be able to Import the relevant System.Data namespace as I alter each Form.

When I add a second differently named Connection String into the project Settings, with one specifying System.Data.sqlclient and one specifying System.Data.odbc, the app.config is produced with both Connection Strings being odbc.

Is there a way in which I can specify both Connection Strings?

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,892 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Torquinian 21 Reputation points
    2025-06-03T09:41:26.9333333+00:00

    I have managed to do this by adding a connectionstring parameter specifying a System DSN.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.