キャッシュ マニフェストを使用して、Web アプリケーションをオフラインでアクセスできるようにしています。SQL Server データベースに接続する機能を追加するまで、すべて正常に動作します (web.config ではなくコード ビハインドに格納されている接続文字列を使用)。このページは、画像やその他のリソースがない単純な空のテスト ページです。どういうわけか、データベース接続が動作を停止しています-以前は(データベース接続を使用していても)動作していましたが、停止しました...
CODE (page_load のみ ... ページ内には何もない) 「tryit2.aspx」というページ
protected void Page_Load(object sender, EventArgs e)
{
//open connections
oConn = new SqlConnection();
oConn.ConnectionString = _connectionString;
oConn.Open();
////----FETCH SUBCAT PRODS FROM DB
_currentDT = new DataTable();
SqlDataReader sqlDR2 = this.executeSQLcommand_returnDataReader(oConn, loadMenu, true, null);
_currentDT = new DataTable();
_currentDT.Load(sqlDR2);
sqlDR2.Dispose();
//dynamically create the cache manifest file
string appPath = Request.PhysicalApplicationPath;
string filePath = appPath + "cache.manifest";
StreamWriter w;
w = File.CreateText(filePath);
w.WriteLine("CACHE MANIFEST");
w.WriteLine("CACHE:");
w.WriteLine("tryit2.aspx");
w.WriteLine("NETWORK:");
w.WriteLine("*");
//closing the streamwriter
w.Flush();
w.Close();
}
それがなぜでしょうか?