using C# How to Import Data from a asp.net GridView to a CSV File
Can you import data from a CSV file and insert it into a ASP.NET GridView? If so, can you provide a code example.
My code that I have so far: (which does not work):
//CSV file input if (radDataInputFormat.SelectedValue == "3") -- I am allowing the user to select which data format that they want to use to insert/import data into the grid - this is for CSV { if (System.IO.File.Exists(fileUploadSI.FileName.ToString())) { System.IO.StreamReader fileReader = new StreamReader(fileUploadSI.FileName); //Check the end of file's content if (fileReader.Peek() != -1) { string fileRow = fileReader.ReadLine(); string[] fileDateField = fileRow.Split(','); } //Close the StreamReader fileReader.Close(); } }