473,320 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ASP.NET/C# Problem connecting to a remote database

hi,

I am attempting to update two databases simultaneously, from one
ASP.NET Web Application, which is written in C#. One database is
local i.e. on my localhost IIS and this has no problems at all. I
uploaded the same database file to my web server and I am having
problems trying to connect to it.

The errors I was getting included "could not lock file", "Cannot open
database ''. It may not be a database that your application recognizes
or the file maybe corrupt". I think my problem lies in the connection
string, because I am unsure of the data source I have to write in
order to connect to my database.

e.g. say the database is at http://www.mywebsite.com/mydb.mdb how is
this written into a connection string? I included it as it is seen
here and it errored saying the UDI format is not supported.

To check if it was the web server, I hosted the database on a friend's
IIS and tried to connect to that, but I have a similar problem with
the connection string and this time the errors are saying that my
source is not a valid file name.

Sorry for the long post and help is much appreciated.

Thanks
Paul Ballatti
Nov 16 '05 #1
2 2011
Make sure you have file write permissions to the DB file.
Nov 16 '05 #2
It needs to be a file path (e.g. "C:\SomeFolder\SomeFile.mdb") not a URL
like "http:// ... " etc.

The 'could not lock file' and 'cannot open database' error messages indicate
that the data source you were using in the connection string when you
received those particular error messages was correct - the data provider was
finding the database in the specified location, but was unable to open it.
The most likely cause is that the account under which the ASP.NET
application is running doesn't have the necessary permissions on that
folder. I use Brinkster as my hosting service, and with Brinkster each user
is given one folder with the necessary permissions, and all MDBs must be
placed in that folder. Your hosting service probably has similar
restrictions, but you really need to talk to your hosting service to find
out exactly what they are.
--
Brendan Reynolds (MVP)

"Paul Ballatti" <pa**********@hotmail.com> wrote in message
news:97**************************@posting.google.c om...
hi,

I am attempting to update two databases simultaneously, from one
ASP.NET Web Application, which is written in C#. One database is
local i.e. on my localhost IIS and this has no problems at all. I
uploaded the same database file to my web server and I am having
problems trying to connect to it.

The errors I was getting included "could not lock file", "Cannot open
database ''. It may not be a database that your application recognizes
or the file maybe corrupt". I think my problem lies in the connection
string, because I am unsure of the data source I have to write in
order to connect to my database.

e.g. say the database is at http://www.mywebsite.com/mydb.mdb how is
this written into a connection string? I included it as it is seen
here and it errored saying the UDI format is not supported.

To check if it was the web server, I hosted the database on a friend's
IIS and tried to connect to that, but I have a similar problem with
the connection string and this time the errors are saying that my
source is not a valid file name.

Sorry for the long post and help is much appreciated.

Thanks
Paul Ballatti

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: stabbert | last post by:
We are running DB2 UDB 8.1.6 in a partitioned environment where we have 8 physical nodes. We have a process that remotely connects to each individual node and loads some data. By setting the...
1
by: Jim Bayers | last post by:
Our network nazi doesn't want us running a webserver on the server that has a connection to the campus database so we created a remote object that runs as a windows service. The windows service...
5
by: bill | last post by:
I am having difficulties connecting to a remote Sql server database in VB.net. Lets say my remote server is found at 255.255.255.255 and its name is MyServer. The database is called MyDatabase....
0
by: acwomble | last post by:
I am working with a database on another system via a ssh tunnel using plink. We have setup an alias the local system for the remote database. I am able to connect and work from within Visual...
0
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
10
by: mairhtin o'feannag | last post by:
Hello, I'm having problems connecting to my new v9 db box. The pertinent information is below: DB2_db2inst1 60000/tcp DB2_db2inst1_1 60001/tcp DB2_db2inst1_2 60002/tcp DB2_db2inst1_END...
2
by: samadams_2006 | last post by:
Hello, I have a problem that I'm hoping someone will be able to help me resolve. 1) I have a C# Web Site in which I connect to the database: "Install Microsoft SQL Server 2005 Express...
3
by: Me LK | last post by:
I did a search but could not find an aswer that worked so here it goes. I just did an upgrade from 2003 to vs 2005 express. I am using a remote sql server 2000. I specifically upgrade to make...
1
by: malooga | last post by:
Hello, I'm having a problem connecting to DB2 on a remote iSeries host from a Linux server, both of which reside on my company's internal network. I'm using the IBM Linux Client V9.1. When I try...
1
by: Lou Civitella | last post by:
I created a test web site with VS2008 using Framework 2.0. Created a database in SQL Server 2005 and am able to connect to it without any problems. I then setup the database to be accessed using a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.