473,385 Members | 2,013 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,385 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 2014
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.