Export CSV\TXT file into ssms

Roy113344

New member
Joined
Apr 1, 2020
Messages
2
Programming Experience
1-3
Hi all,
please your help with import scv\txt file and export it into sql server db .
C# WinForm
Thanks
Roy
 
Your first option should probably be Bulk Copy, which you can do in SSMS with no .NET development at all. If you want to write .NET code to do it, Bulk Copy is implemented using the SqlBulkCopy class. That would require reading the file into a DataTable, which can be done in a variety of ways, including dedicated third-party libraries. You should do a bit of research for yourself, have a go at implementing it and then let us know if and when you encounter a specific issue.
 
Hi,
i want to use .NET code .
Do you have an example ?
i did google search and all examples that found didn't work
Thanks
 
If you couldn't make any other example work then there's no reason to believe that you could make any example I provide work either. There's simply no way that every example you found was wrong. Logic dictates that the way you tried to implement them was wrong. We need to correct the things that you are doing wrong. Show us you're best attempt and we can try to identify what you're doing wrong and help you address that. Maybe I'm wrong but I suspect that you didn't search very hard and didn't make much of an attempt to implement what you found. I'm happy to be proven wrong.
 
Back
Top Bottom