Solved

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

Posted on 2008-10-16
9
1,051 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use SSRS to email customers? 4 22
Subtract dates in vb.net 6 29
What is needed to become a DBA? 7 45
SQL State HYT00. Timeout expired proplem 8 35
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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…
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.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

740 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