Solved

Opening and reading an Excel File From the soruce without uploading

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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