About 1,460,000 results
Open links in new tab
  1. Reading and displaying data from CSV file on Windows Form Application

    Nov 3, 2015 · File.ReadAllLineswill read the file into an enumerable, so you can just do something like var contents = File.ReallAllLines(path) and get rid of the stream reader and then just loop over the contents and split the line there.

  2. C# Program to Read CSV File and Display Data in DataGridView

    This tutorial demonstrates how a csv file can be used to bind data to DataGridView of C#. The code uses System.IO.File.ReadAllText to read the file’s contents into a string. It then uses Split to break the file into lines, ignoring any blank lines.

  3. Reading CSV files using C# - Stack Overflow

    Apr 21, 2020 · I'm writing a simple import application and need to read a CSV file, show result in a DataGrid and show corrupted lines of the CSV file in another grid. For example, show the lines that are shorter than 5 values in another grid. I'm trying to do that like this: row = line.Split(','); importingData.Add(new Transaction. Date = DateTime.Parse(row[0]),

  4. How to read .csv file in C# - FoxLearn

    Jul 16, 2024 · To read a CSV file into a DataTable and display it in a DataGridView in a C# Windows Forms application, you can follow these steps. CSV (Comma Separated Values) is a simple text format, in which values are separated by commas.

  5. Display CSV file in GridView in C# - CSV Reader

    Code sample in C# for displaying a CSV file in a GridView using the DataStreams framework.

  6. c# - Read a CSV file into a Data Grid View (Win Forms) - Stack Overflow

    Mar 7, 2012 · CSV files are common data sources accessible from OLEDb data provider. Fill a DataTable with them and then set the DataTable as DataSource for the GridView. See here.

  7. How to Load CSV Data in a .NET Datagrid Using Visual Studio …

    This blog will demonstrate how to connect to CSV data and display it on the form without writing a single line of code, using only the designer. We will cover: Creating a New Windows Form App Project; Connecting with the CSV Data Source; Creating DataSet from the CSV Data Source; Binding Data to FlexGrid; Ready to Test it Out? Download ...

  8. A C# application to display a CSV file in a grid format and …

    A C# application to display a CSV file in a grid format and provide simple alterations. Current Functionality: Load .CSV file with explorer; Automatically resizes the table to fit data of file; Can edit current data of the loaded file; Saving of the file with explorer; Need to implement: Adding new columns and rows

  9. How to Upload a CSV file in C# Windows Form Application

    Feb 26, 2014 · This article contains C# Windows Form Application code sample to Read or Upload CSV file into Windows Form DataGridView using OpenFileDialog Control to get or browse csv file path and TextFieldParser class from Microsoft.VisualBasic to parse CSV file content.

  10. How to read CSV file in C# - FoxLearn

    Jul 13, 2024 · To read the csv file in c# you should read all the lines, then split data by commas. You need to add your data to the DataTable, then set the DataSource of DataGridView to the DataTable. You can also create the CsvHelper class to help you read data from the csv file by copying the ReadCsvFile method into CsvHelper class.

  11. Some results have been removed