Click here to Skip to main content
14,603,917 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all
I am new to mvc and i have a task to complete which have to read text file and save text file field data on sql table.please any one help me.quick respond really appriciated
Posted
Comments
Timberbird 30-Oct-13 2:16am
   
Have you considered BULK INSERT?
Rate this:
Please Sign up or sign in to vote.

Solution 1

If your text file is in App_Data then you can read it as below.

var fileContents = System.IO.File.ReadAllText(Server.MapPath(@"~/App_Data/file.txt"));
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

Hello,

Please have a look at this[^] answer.

Regards,
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100