I am very new to C# (experienced in VB though) and I want to import some very large pipe (|) delimited files into my SQL Server database.
What I have done so far is created a C# project (using SharpDevelop) and added code to scan a directory for text files with a certain name and identify what the destination table in SQL Server will be based on the file name. I have also created a SQL connection which runs without errors but that is as far as I have got.
So I thought I'd as for advise on how best to take these types of files (some of which are a few thousand KB in size to almost 2GB in size) and import these into SQL Server. The text files also have a header row of column names and a few columns I would like to have formatted as a date. I also want to verify if the table exists first before importing so I know to create it or not.
Should I use some sort of file reader and read the file that way by line or read the entire file? Just not sure the best way to approach this.