majid784
یک شنبه 24 مهر 1390, 18:37 عصر
سلام.
من یه connectionstring به نام MainConnectionString در web.config تعریف کردم. در صفحه aspx ام با دستور زیر میخوام از این connectionstringاستفاده کنم ولی نمیشه. مشکل از کجاست؟
string myConnectionString = WebConfigurationManager.ConnectionStrings["MainConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(myConnectionString );
من یه connectionstring به نام MainConnectionString در web.config تعریف کردم. در صفحه aspx ام با دستور زیر میخوام از این connectionstringاستفاده کنم ولی نمیشه. مشکل از کجاست؟
string myConnectionString = WebConfigurationManager.ConnectionStrings["MainConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(myConnectionString );