Reputation: 13602
Can you explain, at a newbie friendly level, how to bulk import data from a CSV file into a table within a Microsoft SQL Server Compact Edition? I am still at the stage of creating a C# front end to a MS SQL Server CE backend database. This is using MS SQL Server CE 3.5 within Visual Studio 2010 (Ultimate Edition if it matters). I may prefer to do it via a GUI database designer, for ease, though I would welcome SQL commands if it is necessary. This will be done once as the developer, it does not need to be used by the end-user.
I have already done both a google search and Stackoverflow search but have still not succeeded at what I am trying to do.
Upvotes: 3
Views: 5360
Reputation: 41799
You can use my SQL Server Compact Toolbox VS add-in to import (generate INSERT statements) a CSV file to a SQL Server Compact Table - http://sqlcetoolbox.codeplex.com
Upvotes: 5
Reputation: 12554
Once I needed to perform bulk data import into SQL compact I used LINQPad tool for it. You can easily formulate your query in LINQ and you can easily chunk your data from CSV file by using File.ReadAllLines()
, String.Split(chardelimiters, StringSplitOptions)
and Convert.ToInt32()/.ToDouble()
etc.
Upvotes: 0