小编evi*_*ber的帖子

C#和Oracle,登录表单:由于对象的当前状态,操作无效

  private void bLogIn(object sender, EventArgs e)
    {

        string logging = "select * from CLIENT where LOGIN='" + this.t_Login.Text + "' and PASSWORD='" + this.t_Password.Text + "' ;";

        OracleConnection conn = new OracleConnection("Data Source=XXX/orcl;User Id=XXX;Password=XXX;");
        OracleCommand cmd = new OracleCommand();

        cmd.CommandText = logging;
        cmd.Connection = conn;
        try
        {
            conn.Open();
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }



        int count = 0;

        OracleDataReader reader = cmd.ExecuteReader();  // At this line there is the error: Operation is not valid due to the current state …
Run Code Online (Sandbox Code Playgroud)

c# oracle state object

2
推荐指数
1
解决办法
4212
查看次数

标签 统计

c# ×1

object ×1

oracle ×1

state ×1