I try to open the SQL Server Express database file "sample.mdf" but it doesn't work.

Here is the code:

--------------------------------------------------------------------------



using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Data.OleDb;

using System.Data.SqlClient;



public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

//OleDb-ACCESS

//--------------

//OleDbConnection con = new OleDbConnection();

//string comPath = Server.MapPath("~" + @"\") + @"app_Data\webTest.mdb";

//string coS = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + comPath;





//SqlClient-SQL server express

//------------------------------

System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection();

string comPath = Server.MapPath("~" + @"\") + @"app_Data\sample.mdf";

string coS = "Data Source=.\\SQLEXPRESS;AttachDbFilename=" + comPath + ";Integrated Security=True;User Instance=False;";



//OleDb-SQL server express

//-------------------------

//OleDbConnection con = new OleDbConnection();

//string comPath = Server.MapPath("~" + @"\") + @"app_Data\sample.mdf";

//string coS = "Provider=SQLOLEDB.1;" + "Data Source=" + comPath;





con.ConnectionString = coS;

con.Open();



}

}

--------------------------------------------------------------------------

1. Code OleDb-ACCESS (commented) works OK.

2 . When I run the code in section: SqlClient-SQL Server express, I get error:

Server Error in '/myWeb/trySqlServer' Application.


--------------------------------------------------------------------------

CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\MyPrograms\web\trySqlServer\app_Data\sample.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\MyPrograms\web\trySqlServer\app_Data\sample.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

3. When I run the code in section: OleDB-Sql server express I get error:



Invalid authorization specification

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Invalid authorization specification




What should I do to open the SQL Server database "sample.mdf"?



Thank you

Hezi