Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:10:02+00:00 2026-06-06T07:10:02+00:00

I am trying to connect to an SQL Server 2012 database called Remisiones. What

  • 0

I am trying to connect to an SQL Server 2012 database called “Remisiones”. What I did to make sure that the connection string was correct was to create it from the project properties (Setting section, I added the connection string from there and tested connection successfully). This was the resulting connection string:

<configuration>
    <connectionStrings>
        <add name="Remisiones.Properties.Settings.ConnString" connectionString="Data Source=ComputerName\SQLEXPRESS;Initial Catalog=Remisiones;Integrated Security=True"
        providerName="System.Data.SqlClient" />
    </connectionStrings>
    More configuration...
</configuration>

Then, to use it and connect to the database like so:

using (OdbcConnection connection = new OdbcConnection(ConfigurationManager.ConnectionStrings["Remisiones.Properties.Settings.ConnString"].ConnectionString))
{
    connection.Open();
    using (OdbcCommand command = new OdbcCommand("SELECT ID, Date FROM Remisiones", connection))
    using (OdbcDataReader dr = command.ExecuteReader())
    {
        while (dr.Read())
        {
            Result.Text += dr["ID"].ToString();
            Result.Text += "\n";
            Result.Text += dr["Date"].ToString();
            break;
        }
        Result.Text += "</table>";
    }
    connection.Close();
}

This as you can see, should print the Date and ID column values of the first two items in the database. The problem is, instead it gives me the error:

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

What did I do wrong?

EDIT: The error happens in the connection.Open(); line

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:10:03+00:00Added an answer on June 6, 2026 at 7:10 am

    You’re using a System.Data.Odbc connection and command, but trying to pass it a System.Data.SqlClient connection string. The two are not interchangeable.

    Either change your connection string to the Odbc version, or change your code the SqlClient version. (If it’s a SQL Server DB I’d recommend the latter.)

    Your code, using option 2 would change to

    You’ll need to change your “using” statement at the top of the code file (not visible in your code sample, but I’m sure it’s there) to inclue

    using System.Data.SqlClient;
    

    instead of

    using System.Data.Odbc;
    

    and then the following using statement should work (I didn’t check it for syntax errors, but Intellisense should help if I’ve got mistakes)

    using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Remisiones.Properties.Settings.ConnString"].ConnectionString))
    {
        connection.Open();
        using (SqlCommand command = new SqlCommand ("SELECT ID, Date FROM Remisiones", connection))
        using (SqlDataReader dr = command.ExecuteReader())
        {
            while (dr.Read())
            {
                Result.Text += dr["ID"].ToString();
                Result.Text += "\n";
                Result.Text += dr["Date"].ToString();
                break;
            }
            Result.Text += "</table>";
        }
        connection.Close();
    }
    

    Tons of connection string samples, including the System.Data.SqlClient and System.Data.OleDb can be found here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect to a MS SQL Server 2005 Express database that is
i am trying to connect with sql server 2008 using java connection string but
I have a database that I am trying to connect to through SQL Plus.
I'm trying to connect to a SQL Server database using JDBC, the database I'm
I am trying to connect to a SQL Server 2008 database through a C#
I am trying to connect the sql server database using 'sa' from my .Net
I am trying to connect to a SQL Server database, but I don't really
I'm trying to connect to SQL Server 2008 express database from Visual Studio 2010
Hey all I am trying to connect to my SQL Server that I log
I'm trying to connect to an SQL Server 2008 database in a shared hosting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.