Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-10-16
9
Medium Priority
?
1,065 Views
Last Modified: 2013-12-17
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
Comment
Question by:Paramhans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:Kumawat_Shobha
ID: 22728718
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
 
LVL 16

Accepted Solution

by:
Gyanendra Singh earned 1600 total points
ID: 22728787
0
 
LVL 2

Expert Comment

by:tree33
ID: 22728788
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Paramhans
ID: 22728913
I want to store the whole file into database. Can anybody provide me the code for that.
0
 

Author Comment

by:Paramhans
ID: 22728918
means i want complete file and not its content to be stored into database
0
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22728950
did u check my link.. its contain the sample
0
 

Author Comment

by:Paramhans
ID: 22729006
I checked it now but the code is given for storing the image into database. Will it work for an excel file too?
0
 
LVL 2

Assisted Solution

by:tree33
tree33 earned 400 total points
ID: 22738157
Yes, that example will work for all kind of files.
Just change the datatype of the column to varbinary(max).
0
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22738598
yes, it will work
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question