Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Map drive to DB Server

Author  Topic 

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2005-08-10 : 16:56:25
Here's my scenario:
1. Prompt user to load .xls file from their machine
2. On click event of Upload button, save the rows in the .xls file to an existing table on the database server

So, if the existing database table has 10 rows, and the user's .xls file has 10 rows, after the click event of the Upload button, the table will now have 20 rows.

I'm told since the db server is a separate machine, I have to map a drive to the server.

How can I do this w/in my ASP.NET application?

Thanks!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-08-10 : 16:59:40
This is highly not recommended. You should never map drives to the database server unless you are the DBA or server administrator. Doing this from your application is not a good sign. Why can't you do what you need to do on the client machine?

Tara
Go to Top of Page

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2005-08-10 : 17:07:00
I'd love to try to figure it out, but am having trouble.

I'm trying to use the saveas( ) with an HTMLInputFile, but can't get the syntax correct to save to the db server. The following just saves to the client's machine, and not the db server.

getmyFile.SaveAs("C:\TestSaving\" & ServerFileName)

How do I pass:
Server locaction along with username / password.....or whatever to save to a directory on the db server?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-08-10 : 17:12:43
I can't help you with ASP.NET code as I'm a DBA and not a developer. But mapping a drive to the database server is not the way to go. In fact, if you aren't the DBA, then you'll probably be denied this anyway by him/her.

Tara
Go to Top of Page

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2005-08-10 : 17:26:22
Thanks Tara!

I've been trying to get this issue resolved for days now, and keep getting different suggestions. Didn't really like this one anyways.

When I try:
getmyFile.SaveAs("\\servername\C$\TestSaving")

Access to the path "\\servername\C$\TestSaving" is denied.

This is the first part of what I'd like to do. Once it's on the DB Server, I can take it out of this directory and put it in a table.

I've already been successful at loading the metadata of the file to one of the db server tables, but don't know how to convert that to rows in order to populate into the needed data table.
Go to Top of Page
   

- Advertisement -