I'm looking into doing a project in which I would have to import some text files into a MSSQL database. I tried opening one of the files in notepad to take a look at its format and Notepad said it couldn't open it because it was too big. So I tried to open the file with WordPad and it's too big for WordPad I think because the blue busy circle spins forever. I had to run task mangager to stop WordPad, it turns out that WordPad was not responding. So too big for either app to open it seems. Looking at properties of the file, i see that the file size is 0.99 GB. Will I be able to import this file into a table with C#?
Take a look at the IO.Stream classes such as FileStream. I believe all the internal counters use Int64, which is very, very big (Int32 max = 2GB). We have used Stream classes on files over 2GB with no problems.
If you read a file as a stream, it can be as large as you like. I searched for a size limit to MS SQL's nvarchar, and couldn't find one.
When it comes to displaying your text, you will be limited unless the editor supports paging (not all of the file is held in memory at once). The RichTextBox control can hold about 2gb.
Bookmarks