I want to upload a text file and convert its data to datatable
this is my text file form:-
Date/Time;MagazinePos;SampleID;SampleWeight;Moisture;Volatile;Ash;FixedCarbon;Standard;Customer 05-04-2023 15:34:08;1;rcs6737;1.410;3.283;23.761;41.395;31.561;-;HINDALCO 05-04-2023 15:34:08;2;rcs8434;1.100;3.938;26.521;35.089;34.452;- 05-04-2023 15:34:08;3;rcs6630;1.019;4.023;26.570;27.845;41.562;- 05-04-2023 15:34:08;4;rcs8960;1.022;4.266;26.563;33.735;35.436;-
Naimish MakwanaPosted Apr 12, 2023, 9:30 AM
To write an API that can upload a text file and create a datatable in C#, you can follow these steps:
Here is a sample code that demonstrates the above steps:
Thanks
Naimish Makwana
Sandeep KumarPosted Apr 12, 2023, 8:54 AM
how can u do this via normal in c#
Jignesh KumarPosted Apr 12, 2023, 8:32 AM
Hello,
You can create below controller and post method to upload file, and do call from UI using ajax,