Guys, I have a problem with setting up connection from asp file to MS Sql db.
I'm using Web.Config as the file to setup the connection:
<connectionStrings>
<add name="AMConn" connectionString="Data Source=TWS_WS04;Initial Catalog=AccessMed;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
My connection to the db from aspx file:
string strSQL = "SELECT * FROM Client";
SqlConnection myConnection = new SqlConnection(ConfigurationManager.AppSettings["AMConn"]);
SqlDataAdapter myCommand = new SqlDataAdapter(strSQL, myConnection);
DataSet objDataSet = new DataSet();
myCommand.Fill(objDataSet, "Client");
DataTable objDataTable = objDataSet.Tables["Client"];
And the error message: "The ConnectionString property has not been initialized."
I know that there is a problem with my connection because no matter what I put as AppSettings["ANYTHING I WANT"]); - the error is always the same.
I'm new to asp.net and I would appreciate any help.
Thanks,
Jim