Results 1 to 4 of 4

Thread: WinForm to read and search csv file

  1. #1
    shaun.rahman is offline C# Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Apr 2017
    Posts
    2
    Rep Power
    0

    WinForm to read and search csv file

    Hi,

    Thank you for reading my post! I'm a complete beginner and I need your help to read a static hard coded .csv file, display it's content in a gridview with search functionality.

    When the application loads, I want to display as much data as I can on the gridview in alphabetical order and use the search field to search for any data on the csv file.

    I have attached the winform design and the csv file. Please note the csv file does not contain all the data.

    Please help me as I'm racking my brain out.

    Many thanks in advance.
    Attached Files Attached Files
    Last edited by JohnH; 04-19-2017 at 2:41 AM. Reason: removed generated binaries (bin + obj folders) from attachment

  2. #2
    JuggaloBrotha's Avatar
    JuggaloBrotha is offline C# Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2011
    Location
    Lansing, MI; USA
    Posts
    87
    Rep Power
    77
    Quote Originally Posted by shaun.rahman View Post
    Hi,

    Thank you for reading my post! I'm a complete beginner and I need your help to read a static hard coded .csv file, display it's content in a gridview with search functionality.

    When the application loads, I want to display as much data as I can on the gridview in alphabetical order and use the search field to search for any data on the csv file.

    I have attached the winform design and the csv file. Please note the csv file does not contain all the data.

    Please help me as I'm racking my brain out.

    Many thanks in advance.
    Let's take a step back and start with, do you know how to read a csv file in .Net?

  3. #3
    shaun.rahman is offline C# Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Apr 2017
    Posts
    2
    Rep Power
    0
    Hi JuggaloBrotha,

    Thanks for your reply. I'm a complete beginner with C sharp. I used to code in C, C++, Modula 2, Cobol etc about 20 years ago.

    I don't know how to load a hard coded csv file nor do i know how to search that csv file. Please can you guide me as much as you can if you have the time

    Thanks in advance

  4. #4
    JuggaloBrotha's Avatar
    JuggaloBrotha is offline C# Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2011
    Location
    Lansing, MI; USA
    Posts
    87
    Rep Power
    77
    Quote Originally Posted by shaun.rahman View Post
    Hi JuggaloBrotha,

    Thanks for your reply. I'm a complete beginner with C sharp. I used to code in C, C++, Modula 2, Cobol etc about 20 years ago.

    I don't know how to load a hard coded csv file nor do i know how to search that csv file. Please can you guide me as much as you can if you have the time

    Thanks in advance
    Well for starters reading the file you'll want to become familiar with the System.IO namespace, specifically the System.IO.StreamReader for reading files.
    If you want the user to be able to browse the system and select the file to be read, you can use the OpenFileDialog.
    As for parsing the CSV file, the rules are really simple for that too.
    All of what I mentioned there's tons of examples you can find via very quick Google searches.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •