其实很早就想作一个象样一点的ASP.NET程序,可是都无法从网上找到一个可以让我放上去的站点,并且我一向对于WEB不是很有感觉,主要是那些HTML/JAVASCIPT语言我可能IDE用多了。昨天突然想起很早以前申请的一个MONO演示站点,MONOLINUX下的.NET移植。试验了一下,好像不行。

我敲了一个最简单的数据库程序:

string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + this.MapPath("guestbook.mdb") + ";";
   string MySQL= "SELECT Name, EMail, URL, Comment FROM Guestbook";
   OleDbConnection  MyConn =new OleDbConnection(strConn);
   OleDbCommand Cmd = new OleDbCommand(MySQL, MyConn);
   MyConn.Open ();
   OleDbDataReader rd= Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
   rd.Read();
   TextBox1.Text =rd.GetString(0);
   rd.Close();
   MyConn.Close();

本机演示OK,FTP上去之后,出现运行错误。

Server error in \’/\’ application
——————————————————————————–
Description: Error processing request.
Error Message: HTTP 500.

Stack Trace: System.InvalidOperationException: State != Open
in <0×001ce> System.Data.OleDb.OleDbCommand:ExecuteReader (System.Data.CommandBehavior)
in <0×00045> (wrapper remoting-invoke-with-check) System.Data.OleDb.OleDbCommand:ExecuteReader (System.Data.CommandBehavior)
in <0×000ab> Yipee.WebForm1:Page_Load (object,System.EventArgs)
in <0×00045> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
in <0×00056> System.Web.UI.Control:OnLoad (System.EventArgs)
in <0×00026> System.Web.UI.Control:LoadRecursive ()
in <0×00149> System.Web.UI.Page:InternalProcessRequest ()
in <0×000a9> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext)
in <0×00233> ExecuteHandlerState:Execute ()
in <0×0007c> StateMachine:ExecuteState (System.Web.HttpApplication/IStateHandler,bool&)

看了是没有什么办法了。[hide]http://www.monoforge.com/ [/hide]

直接 TextBox1.Text="sdffds"; 倒是可以运行,不知道是不是可以采用XML作为存储。

历史博文

标签:, , , ,
七月 2, 2005 at 10:11 上午 by yippee 1,028 次
Category: Dev
Tags: , , , ,