Hi,
I am having a connection problem to my database only when i upload the files to my web server. My database lives in a folder called private. I don't know how to point to this database. The database works fine on my local machine just not on my web server.
my code:
Problem is with the Data Source, how do i point it to my database, my hosting guys are useless and will not help me!Code:private void Page_Load(object sender, System.EventArgs e) { // Connect to the database OleDbConnection myConn; OleDbCommand myCmd; OleDbDataReader myReader; myConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=//..//..//..//..//private//mydatabase"); String SQL = "SELECT url FROM links"; myCmd = new OleDbCommand(SQL, myConn); myConn.Open(); myReader = myCmd.ExecuteReader(); displayLinks.DataSource = myReader; displayLinks.DataBind(); myConn.Close(); }
Any advice or pointers greatly appreciated.


Reply With Quote