问题描述
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Data.OracleClient;usingSystem.Windows.Forms;namespaceWindowsFormsApplication1{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}privatevoidForm1_Load(objectsender,EventArgse){//TODO:这行代码将数据加载到表“dataSet11.TABSALORDER”中。您可以根据需要移动或移除它。stringConnectionstring="DataSource=hq100;UserID=hq2005;Passwordhq2005;Unicode=True";OracleConnectionconn=newOracleConnection(Connectionstring);//try//{conn.Open();OracleCommandcmd=conn.CreateCommand();cmd.CommandText="select*fromtabsalorderwherefdate>'2010-01-01'";OracleDataReaderodr=cmd.ExecuteReader();while(odr.Read()){this.tABSALORDERTableAdapter.Fill(this.dataSet11.TABSALORDER);}}//catch(Exceptionee)//{//Response.Write(ee.Message);//如果有错误,输出错误信息//}}privatevoidbutton1_Click(objectsender,EventArgse){MessageBox.Show(this.dataSet11.TABSALORDER.Rows.Count.ToString());}}错误1当前上下文中不存在名称“Response”C:UsersAdministratorDocumentsVisualStudio2008ProjectsWindowsFormsApplication1WindowsFormsApplication1Form1.cs3817WindowsFormsApplication1不知道如何解决!
解决方案
解决方案二:
你是直接copy别人的代码吧。winform引用程序里一般没有response.Write(),这是webform里才用的
解决方案三:
response.Write()是WEBform的
解决方案四:
引用楼主wjazq的回复:
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Data.OracleClient;usi……
你把它删除了或者注释不就行了