How to store an excel file in sql server????????????

Hi experts,

      I want to store some whole excel file into sql server database, but dont know how to do it. I want to do it using asp.net and C#.

      Can anybody help me for this.

Regards,
Paramhans
ParamhansAsked:
Who is Participating?
 
Gyanendra SinghConnect With a Mentor ArchitectCommented:
0
 
Kumawat_ShobhaCommented:
pass this filepath(filepath\filename.xls) to a stored procedure as a argument
and user openrowset query in your stored procedure to store this excel file in to sql server database
0
 
tree33Commented:
Do you want to import to content of the Excel to a table, or save the file in the database?
If you want to save to file then u could use a varbinary datatype to store binary data.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
ParamhansAuthor Commented:
I want to store the whole file into database. Can anybody provide me the code for that.
0
 
ParamhansAuthor Commented:
means i want complete file and not its content to be stored into database
0
 
Gyanendra SinghArchitectCommented:
did u check my link.. its contain the sample
0
 
ParamhansAuthor Commented:
I checked it now but the code is given for storing the image into database. Will it work for an excel file too?
0
 
tree33Connect With a Mentor Commented:
Yes, that example will work for all kind of files.
Just change the datatype of the column to varbinary(max).
0
 
Gyanendra SinghArchitectCommented:
yes, it will work
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.