Errro message The operation could not be completed. The connectionString property has not been initialized (System.Data) ·

Richard Argento 26 Reputation points
2021-10-07T22:18:09.757+00:00

This question has been asked before by user member of this forum called cris123456 who also displays a large Nazi swastika as part of his profile logo,

Does that violate this forum's rules?

What he asked, and what I ask is this: I'm trying to upload data from .csv to a table by the SQL Server Import and Export Wizard However, I received this error: The operation could not be completed. The connectionString property has not been initialized (System.Data) ·

The answer he receive was Hi Cris,

If you’re using SQL Server Import and Export Wizard to load CSV file into database, you could choose “flat file source” in DataSource dropdown list and then refer to following link to set it., etc.

However, when I use the choose “flat file source” selection then I cannot format the resulting .dbo table's columns and the result is that column headings are not recognized and columns' data are formatted incorrectly.

To avoid that, I used the "Import Data" choice on the SQL Server Import and Export Wizard, which THEN allows me to select the type of file I am trying to import and I THEN specified "flat file" and the specific .csv file I wanted, and the Import and Export Wizard allowed me to check a box specifying the column headings for the table:

I did so, and I pressed the "Next" button and received the error message :

The operation could not be completed. The connectionString property has not been initialized (System.Data) ·

Howe do I get past this, given that the answer last time this question arose would not work for me, given my need to format the columns of the table, including column headings?

Developer technologies | Transact-SQL
SQL Server | Other
0 comments No comments
{count} vote

Accepted answer
  1. Erland Sommarskog 121.9K Reputation points MVP Volunteer Moderator
    2021-10-08T21:45:53.107+00:00

    You have selected the .NET provider for ODBC. I don't think that is a good option to import flat files. And if you want to use it, you need to specify an ODBC driver on the second page.


3 additional answers

Sort by: Most helpful
  1. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    2021-10-11T00:43:17.17+00:00

    Hi @Richard Argento ,

    Sorry for reply late. I rested on weekend.

    > I am using Microsoft SQL Server MS Version 18, maybe that is why your suggested solution does not work on my particular installaton:

    My screenshot also from SSMS 18.x. I think that I should give you detail steps about this, it may make you better understood my suggestion.

    You got the error message as the screenshot that you offered in previous post when you choose a destination source. This error means that you did not choose the correct provider for the destination source.

    I assume you choose SQL Server database as the target data source, this means that you want to import data from CVS file to SQL server database. so I suggested you choose the correct the provider for SQL server as my first post mentioned. If I misunderstood your target data source, please let me know. You need to choose a correct provider for your target data source. If not you will got the error message that you got in the screenshot.

    Please check the detail steps for my suggestion.

    1. Choose CVS file location.
      139229-screenshot-2021-10-11-081955.jpg
    2. Choose the correct provider for destination source SQL server. Please scroll down the list of providers and then select SQL server Native client 11.0 for SQL server database source on Destination box.

    139198-screenshot-2021-10-11-082113.jpg

    3... Type the correct SQL server instance name, choose the correct authentication for SQL server, choose the correct database that you want to store the data from CVS file.

    139199-screenshot-2021-10-11-082214.jpg

    Then Next and Next.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar thread.

    1 person found this answer helpful.

  2. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    2021-10-08T00:51:31.287+00:00

    Hi @Richard Argento ,

    Welcome to Q&A forum.

    >I received this error: The operation could not be completed. The connectionString property has not been initialized (System.Data) ·

    Please make sure that you have choose the correct provider for destination source SQL server as below screenshot.

    138714-screenshot-2021-10-08-084658.jpg

    Refer to this similar thread.

    If your issue did not occur on this step, please share us a screenshot of your issue that you got the error message to make us better understand your issue. It will help us to give you a better help.

    By the way, suggest you reading the blog Import csv into SQL server (with query OR without query using SSMS), it will show you the detailed steps about importing CVS to SQL table.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar thread.


  3. zaz 0 Reputation points
    2025-01-12T12:29:46.7933333+00:00

    I solved it watching this video I found on YouTube

    https://youtu.be/brGq2by7DvA?si=1Cf701DvRWdR6FXq

    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.