Answered Upload csv file to MS SQL Database

  • Wednesday, August 08, 2012 10:54 PM
     
     

    I'm sorry to ask this question, but I have been at it for about a week now and can't seem to find an answer that works.

    I am trying to create a web interface that allows users to upload data from a csv file to a SQL database. I am using C#, Visual Studio 2010, and MS SQL 2012. All of the forums and posts I have read on various sites seem like they should work, but for one reason or another they fail. If someone has a simple solution, I would greatly appreciate it.

All Replies

  • Thursday, August 09, 2012 1:29 AM
     
     Proposed

    Hi,

    Here is an easy to follow blog post for what you are looking for - http://www.codeproject.com/Articles/30705/C-CSV-Import-Export


    Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com

    • Proposed As Answer by Seth Lynch Thursday, August 09, 2012 10:18 AM
    •  
  • Thursday, August 09, 2012 3:37 PM
     
     

    I have tried this one, but get the following error:

    "The type or namespace name 'DataSet' could not be found (are you missing a using directive or an assembly reference?)"

  • Tuesday, August 14, 2012 7:28 AM
    Moderator
     
     

    I have tried this one, but get the following error:

    "The type or namespace name 'DataSet' could not be found (are you missing a using directive or an assembly reference?)"

    Hi bwsmith707,

    Thanks for update.

    Please double check that you haven’t misspelled the name of the type or namespace that you are trying to use. Without the correct name, the compiler is unable to find the definition for the type or namespace that you referred to in your code. This occurs most often because C# is case-sensitive and you didn’t use the correct capitalization when you referred to the type.

    And also you may not have the proper using directive, or you may have not fully qualified the name of the type. To be able to use the DataSet type you need two things. First, you need a reference to the assembly that contains the definition for the DataSet type. Second, you need a using directive for the namespace where DataSet is located. For more details, please refer to this article: PRB: Compiler Error CS0246: The Type or Namespace Name <Type/Namespace> Could Not be Found.


    Best Regards,
    Ray Chen


  • Thursday, August 16, 2012 2:53 AM
     
     Answered
    • Marked As Answer by bwsmith707 Thursday, August 16, 2012 2:53 AM
    •