Solved

Opening and reading an Excel File From the soruce without uploading

Posted on 2009-06-30
5
291 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

19 Experts available now in Live!

Get 1:1 Help Now