Excel file path is in server folder i need to read from there and update in sql
now data is reading from my local path and updating in sql
but i need to change local path to server path for reading and once it is updated in sql then it should move to another folder (like filename is read folder) using console C# application i'm working on it
Please help me on this
Naimish MakwanaPosted Mar 21, 2023, 12:15 PM
Try below solution.
Define the source folder path (local folder path or server folder path) and the destination archive folder path.
Use the System.IO namespace to get the files from the source folder path.
Loop through the file paths and perfrom your import logic
Once the data is imported, use the File.Move method to move the file to the archive folder. bulk copy method to import the data from the Excel file to SQL.
Thanks
Naimish