Ok so I have made ASP.NET website I have used Access database 2010 but I am having problems with one particular thing when I try and run the website I am getting this error which says OleDbException was unhandled by user code and Could not find file 'C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\CitiesDatabase.accdb'. The error points at
myTable = new DataTable();
Here is my code:
Code blocks are created by indenting at least 4 spaces
... and can span multiple lines
public partial class NavigateDatabase : System.Web.UI.Page
So... my first question is... is this website hosted on a domain somewhere or is it hosted on your local computer?
The reason I ask this is because your connection string seems to be pointing at an access database on a local drive as such:
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\CitiesDatabase.accdb
So... if it's hosted online one might want to double-check the connection string to ensure it's properly pointing to the .accdb file location. One may also want to make sure that the perms on that file are set correctly in such a way that the code can actually reach the file (i.e.: readable/writable).
It's somewhat difficult to tell as the code you provided doesn't seem to fully encompass the connection string other than to reference a connection type and a .mdb file and doesn't indicate anywhere within where it would be referencing CitiesDatabase.accdb.
My thought is that, if it's not related to the code above... you may have data connections hard coded into the front end of your page in datatables or dropdowns or the likes which are pointing at local files instead of site resources.