Reputation: 1
I'm new in c# and i feel i m in trouble. in my project i want to import excel file to sql server 2008 but i want to user choose the excel file.i search lots of source but all of them define the way of excel file in the code,but i want to user browse and user select excel file.Then other things row -row or colomn will transfer to sql server. On the other hand i would give information on my project,it will be good for me to explain problem.First user selects excel file and it will be imported database again user selects other excel file one by one.The importent thing is how i can give way of excel file dynamically. if you will help,i will be grateful. Thank you...
Upvotes: 0
Views: 307
Reputation: 3179
hi it looks like you need to use Open File Dialog box. Here is the example code how to use http://msdn.microsoft.com/en-us/library/aa969773.aspx However, remember that if you are going to deploy this application to any server you have to bear in mind that you cant use traditional ways of initiating Excel objects and reading the data in sheets. As you will not have MS office installed on server. And if you install them you will be violating the licence. Here is an example how you can do the actual import http://www.codeproject.com/Articles/115578/Excel-to-SQL-without-JET-or-OLE-Version-2
Upvotes: 1