Solved

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

Posted on 2014-01-14
1
1,447 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 500 total points
ID: 39781426
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# MDI - Use Button on Child Form to Open (or Show) a Different Child Form 3 44
Data Analysis 7 59
SQL State HYT00. Timeout expired proplem 8 43
Example code 13 42
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 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