hi all,
---put in mind that im doing an ASP.NET website....
i made a DB using VS2010 (installed SQL server 2008 with the VS 2010 installation).
the DB is in the App_Data folder.
in the default.aspx.cs file i wrote this
Sqlconnection con = new sqlconnection();
con.connection = "server=.\\SQLEXPRESS;AttachdbFile=|DataDirectory|\\Database.mdf;Database=Database;Trusted=true;"
this results in an error:::
"Cannot attach file "C:\bbbb\bbbb\bbb\Database.mdf" to Database "Database"".
whats the problem here?
by the way, the code is in the page_load function and i have included the SQL classes