Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I bought a hosting and domain, how to connect my desktop application to the database i uploaded to my hosting?

C#
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= http://www.sampledomain.com/database.mdb ;Jet OLEDB:Database Password=password";

System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connectionString); 
System.Data.OleDb.OleDbCommand cmd = conn.CreateCommand();


Error show it's not a valid file name. please help,thanks in advance =)
Posted
Updated 12-Jun-11 2:07am
v6
Comments
Аslam Iqbal 12-Jun-11 6:03am    
Try to use ODBC or learn to use the class MarshalByRefObject.
Kim Togo 12-Jun-11 9:08am    
@melvintcs, please use "Add Comment" under each solution.

You cannot use an Access database for this. Access is a file-based database and hence, will only work with file paths(be it drive letter based or UNC paths), not over HTTP or any other protocol.

In order for you to do this, you'll have to use whatever database engine your hosting company supplies, such as SQL Server.

On top of all this, you'll only be able to connect to your database IF the hosting company exposes the SQL Server directly to the Internet.
 
Share this answer
 
v2
 
Share this answer
 
Comments
Kim Togo 12-Jun-11 9:07am    
[From OP]
i cant find any connection string which suitable for me. please advice :)
Are you double-damn sure that the file exists?
 
Share this answer
 
Comments
Kim Togo 12-Jun-11 9:07am    
[From OP]
the url i provided above is just a sample url:)

and yes, im very sure that the file is exists.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900