日期:2014-05-20  浏览次数:20475 次

ASP。NET连接DB2 非常急的问题!!!!!!各位兄弟姐妹救急啊
客户端(   win2000   server     )DB2   应用程序开发客户端,VS2003  
服务器端(aix   64位   DB2   8。2)  
直接通过客户端我可以访问   第一次做DB2数据库,谁可以告诉我应该怎么配置了,非常感谢
  using   IBM.Data.DB2;
   
DataTable   dt   =   new   DataTable();
DB2Connection   conn=DB2Connection( "= "Database=AA;uid=AA;pwd=AA; ");
string   sql= "select   *   from   tid_info ";
conn.Open();
DB2DataAdapter   da   =   new   DB2DataAdapter(sql,conn);
da.Fill(dt);
this.DataGrid1.DataSource=dt;
this.DataGrid1.DataBind();
在conn.Open()   出现异常
ERROR   [58005]   [IBM][DB2.NET]   SQL0902   An   unexpected   exception   has   occurred   in     Process:   1008   Thread:   1668   AppDomain:   名称:/LM/W3SVC/1/Root/NX-18-128145888832381632\r\n无上下文策略。\r\n   Function:   SQLConnect\n   CallStack:         at   System.Environment.GetStackTrace(Exception   e)\r\n       at   System.Environment.GetStackTrace(Exception   e)\r\n       at   System.Environment.get_StackTrace()\r\n       at   IBM.Data.DB2.DB2ConnPool.a(String   A_0,   Exception   A_1,   Boolean   A_2)\r\n       at   IBM.Data.DB2.d.a(String   A_0,   Int32   A_1,   Int32   A_2,   IsolationLevel   A_3,   DB2Connection   A_4)\r\n       at   IBM.Data.DB2.DB2ConnPool.a(DB2Connection   A_0,   String   A_1,   a&   A_2,   Object&   A_3)\r\n       at   IBM.Data.DB2.DB2Connection.Open()\r\n       at   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection   connection,   ConnectionState&   originalState)\r\n       at   System.Data.Common.DbDataAdapter.FillFromCommand(Object   data,   Int32   startRecord,   Int32   maxRecords,   String   srcTable,   IDbCommand   command,   CommandBehavior   behavior)\r\n       at   System.Data.Common.DbDataAdapter.Fill(DataTable   dataTable,   IDbComm
and   command,   CommandBehavior   behavior)\r\n       at   System.Data.Common.DbDataAdapter.Fill(DataTable   dataTable)\r\n       at   NX.WebForm1.Page_Load(Object   sender,   EventArgs   e)   in   e:\\我的文档\\农信\\程序文件\\nx\\webform1.aspx.cs:line   34\r\n       at   System.Web.UI.Control.OnLoad(EventArgs   e)\r\n       at   System.Web.UI.Control.LoadRecursive()\r\n       at   System.Web.UI.Page.ProcessRequestMain()\r\n       at   System.Web.UI.Page.ProcessRequest()\r\n       at   System.Web.UI.Page.ProcessRequest(HttpContext   context)\r\n       at   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()\r\n       at   System.Web.HttpApplication.ExecuteStep(IExecutionStep   step,   Boolean&   completedSynchronously)\r\n       at   System.Web.HttpApplication.ResumeSteps(Exception   error)\r\n       at   System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext   context,   AsyncCallback   cb,   Object   extraData)\r\n       at   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest   wr)\r\n       at   System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest   wr)
\r\n       at   System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr   ecb,   Int32   iWRType)   InnerException   Message:   未将对象引用设置到对象的实例。   Check   InnerException   property   for   more   detail.     SQLSTATE=58005