Solved

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

Posted on 2008-10-16
9
1,046 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 400 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
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 

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 100 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

756 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