关于oracle的小问题求指教
代码如下但是没有结果俺不执行只能执行到conn。open然后就跳到catch了求解求指教,先谢
private void button1_Click(object sender, EventArgs e)
{
string str = "data source=sid;user=scott;password=tiger";
OracleConnection conn = new OracleConnection(str);
try
{
conn.Open();
OracleCommand com = conn.CreateCommand();
com.CommandText = "select * from scott.emp";
OracleDataReader dr = com.ExecuteReader();
while (dr.Read())
{
this.textBox1.Text = dr.GetOracleString(0).ToString();
}
dr.Close();
}
catch
{
MessageBox.Show("error");
}
finally
{
conn.Close();
}
------解决方案--------------------string str = "data source=sid;user=scott;password=tiger";
连接字符串有问题
------解决方案--------------------http://wenku.baidu.com/view/48289b16866fb84ae45c8d5b.html 参考下别人怎么写的