Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
I have to build a C# MVC web application. This is my first exposure to C# and MVC both. The requirement is that there could be one or more csv files with FileName_mm-dd-yyyy.csv. I need to add the data in these files to an SQL table which has one more column in the begining as a date which date in the file name -1.

I know how to use Database first to create the basic application with the default views. Can someone help me how to proceed from here onwards.


What I have tried:

This is my first experience with C# and MVC structure. I have so far learned how to build a basic application. I am planning to use database first approach here.
Posted
Updated 27-Sep-16 17:28pm
v2
Comments
[no name] 27-Sep-16 13:52pm    
What is your question? What one specific issue with the code that you have written is giving you problems? So far, your whole posting can be condensed to "I have a project to do. Can someone teach me programming in a forum posting?" and the answer is no we can't.

1 solution

First you will have to analyse the strucutre of the data in the CSV file and based on that create schema for Tables in SQL.

refer these docs,
c# - How to read a CSV file into a .NET Datatable - Stack Overflow[^]
c# - Insert datatable in to sql table - Stack Overflow[^]
Comma-separated values [^]
 
Share this answer
 
Comments
DinoOnCodeProject 7-Nov-16 11:53am    
Thanks a lot Karthik, the requirement was changed to create a console app which was quite easy for me using C# but the second link you advised was really helpful. Thanks a lot.
Karthik_Mahalingam 8-Nov-16 2:07am    
welcome :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900