[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

using C# How to Import Data from a asp.net GridView to a CSV File

Posted on 2014-01-14
1
Medium Priority
?
1,467 Views
Last Modified: 2014-05-07
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();
            }
        }

Open in new window

0
Comment
Question by:newjeep19
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 16

Accepted Solution

by:
Stephan earned 2000 total points
ID: 39781426
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question