?
Solved

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

Posted on 2008-10-16
9
Medium Priority
?
1,058 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
Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

 

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

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

777 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