Solved

Opening and reading an Excel File From the soruce without uploading

Posted on 2009-06-30
5
310 Views
Last Modified: 2012-05-07
Hello all
My asp.net 2.0 application  needs  to open an excel file and read the content for writing into DB.
In order to do this  ,currenty I upload document into application  server and take IIS directory reference of file and read it.
However my hosting department does not allow me saving excel  file in server,they suggest saving it on a shared file and read/write from there which is not a better option for us.
Do you know how can I   open  and read an excel file   from the soruce location without uploading ?
is there a way ?

thanks in advance for the all answers

0
Comment
Question by:hedgeselect
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:boowhup
ID: 24745085
if the share is on the same domain/network as the app server then just change the location from

(c:\myfolder\myexcel.xls) to (\\otherserver\sharedfolder\myexcel.xls) in your connection string.

You could do some checks before you create the connection ....

IF Exists "otherserver\sharedfolder\myexcel.xls" then
   db.execute
end if

etc etc
0
 

Author Comment

by:hedgeselect
ID: 24746860
This is ok  ,
but as I emphasize in my question I need to read directly from the source rather than puting file in shared area .is it doable ?
0
 
LVL 5

Expert Comment

by:boowhup
ID: 24746879
make the folder a share on your network perhaps?

Is there any reason the source cant be ona  network share?
0
 

Author Comment

by:hedgeselect
ID: 24747093
if I open a network share and give access to whole intranet  , can an external server  in the intranet reach and read /write to file  ?
0
 
LVL 5

Accepted Solution

by:
boowhup earned 500 total points
ID: 24747192
Yep, if you're part of a domain you can make it read and/or write to a single user, the whole domain, security group etc etc

If you're not part of a domain you can still narrow it down to a user or users, but would have to setup the same username amd password on the server to access the file. Or just make it wide open for everyone.

This is of course talking about intranet , internet is a whole different story. Better of migrating the excel into a sql server, and using excel to interface it at your end.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now