Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
4.00/5 (1 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?

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"));
 
Share this answer
 
v2
Hello,

Please have a look at this[^] answer.

Regards,
 
Share this answer
 

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