• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1071
  • Last Modified:

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
0
Paramhans
Asked:
Paramhans
  • 3
  • 3
  • 2
  • +1
2 Solutions
 
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
 
Gyanendra SinghArchitectCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
tree33Commented:
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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now