Import data from csv to ms access database using c#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yemyem
    New Member
    • Oct 2009
    • 1

    Import data from csv to ms access database using c#

    Hi Guys,

    im new to the c# language and im liking it so far. What im currently trying to do is write a windows form application so that when the user clicks on a button the application will read the csv and then import it into an MS Access database. What i can do is read the csv file using the SteamReader and displaying it on a DataGrid. I can also connect and read from the access database ok but im not quite sure how to import the data into the database.

    Thanks in advance

    Yem
  • cloud255
    Recognized Expert Contributor
    • Jun 2008
    • 427

    #2
    If the data is in memory, you need to connect to the database and use SQL insert statements to save the data.
    Have a look at the OLEDB Connection and OLEDB Command classes.

    The connection is used to connect to the database and the commands are executed against a database using a connection.

    Comment

    Working...