Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1067
  • 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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