缺少using指令
usingSystem.Data.SqlClient;usingSystem.Collections.Generic;usingSystem.ComponentModel...
using System.Data.SqlClient;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
OracleConnection connection = new OracleConnection("user id=chtobacco;data source=TOBACCO_172.40.1.215;password=tobacco");
connection.Open();
string cmdText = "select * from STU";
Sqlcommand cmd = new Sqlcommand (cmdText,conn);
Sqldatareader reader = cmd.executeReader();
while(reader.read()==true)
{
txtbox1.text = reader["ID"].tostring();
txtbox2.text = reader["NAME"].tostring();
textBox3.Text = reader["AGE"].tostring();
break;
}
conn.Close();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
// textBox1.Text = reader["ID"].tostring();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
//textBox2.Text = reader["NAME"].tostring();
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
//textBox3.Text = reader["AGE"].tostring();
}
}
}
错误 1 找不到类型或命名空间名称“EventArgs”(是否缺少 using 指令或程序集引用?) C:\Documents and Settings\User\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication6\WindowsFormsApplication6\Form1.cs 19 48 WindowsFormsApplication6 展开
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
OracleConnection connection = new OracleConnection("user id=chtobacco;data source=TOBACCO_172.40.1.215;password=tobacco");
connection.Open();
string cmdText = "select * from STU";
Sqlcommand cmd = new Sqlcommand (cmdText,conn);
Sqldatareader reader = cmd.executeReader();
while(reader.read()==true)
{
txtbox1.text = reader["ID"].tostring();
txtbox2.text = reader["NAME"].tostring();
textBox3.Text = reader["AGE"].tostring();
break;
}
conn.Close();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
// textBox1.Text = reader["ID"].tostring();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
//textBox2.Text = reader["NAME"].tostring();
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
//textBox3.Text = reader["AGE"].tostring();
}
}
}
错误 1 找不到类型或命名空间名称“EventArgs”(是否缺少 using 指令或程序集引用?) C:\Documents and Settings\User\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication6\WindowsFormsApplication6\Form1.cs 19 48 WindowsFormsApplication6 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询