Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-534

[OLEDB] return value of OleDbDataAdapter.Fill(DataTable) is not right

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: OLEDB-9.1.0.p1
    • Fix Version/s: OLEDB-9.1.0.p1
    • Component/s: OLEDB
    • Labels:
      None
    • Environment:
      • OS: Window7 32bit
      • Server Version:CUBRID 9.1 (9.1.0.0212) (64bit release build for linux_gnu) (Mar 14 2013 00:16:33)
      • Driver Version:OLEDB driver 9.1 (timestamp:20130422-14175366)

      Description

      • Brief:
        • return value of OleDbDataAdapter.Fill(DataTable) is not right
      • Test Code
        Create table demotable(id INT NOT NULL);
        insert 5 record data into demotable
        	[Test, Description("test OleDbDataAdapter File(DataTable)")]
                public void AdapterInit_File_DataTable1()
                {
                    string strSql = "select * from demotable";
                    string strCount = "select count(*) from demotable";
        	    string strConnection="Provider=CUBRIDProvider;Data Source=testdb;Location=127.0.0.1;User ID=dba;Password=xxx;Port= 33000"
        	    OleDbConnection connCubrid = new OleDbConnection(strConnection);
        	    OleDbCommand cmdCubrid = new OleDbCommand(strSql, connCubrid);
                    OleDbDataReader reader = cmdCubrid.ExecuteReader();
                    reader.Read();            
                    OleDbDataAdapter adapter = new OleDbDataAdapter(strSql, connCubrid);
                    DataTable dt = new DataTable();
                    Assert.AreEqual(reader.GetInt32(0), adapter.Fill(dt));
                }
        
      • Result:reader.GetInt32(0):5, adapter.Fill(dt):0

        Activity

        Hide
        cn15800 谢韦华[Bert] added a comment -

        Oledb Driver can support DataSet:

        DataSet dataset = new DataSet();
        int col = adapter.Fill(dataset);

        DisplayData(dataset.Tables[0]); // result

        Show
        cn15800 谢韦华[Bert] added a comment - Oledb Driver can support DataSet: DataSet dataset = new DataSet(); int col = adapter.Fill(dataset); DisplayData(dataset.Tables [0] ); // result
        Hide
        cn15800 谢韦华[Bert] added a comment -

        fixed,result:

        S_NAME = X
        F_NAME = Mixed
        ============================
        S_NAME = W
        F_NAME = Woman
        ============================
        S_NAME = M
        F_NAME = Man
        ============================
        S_NAME = B
        F_NAME = Bronze
        ============================
        S_NAME = S
        F_NAME = Silver
        ============================
        S_NAME = G
        F_NAME = Gold
        ============================
        请按任意键继续. . .

        test case:
        static public void AdapterInit_File_DataTable1()

        { string strSql = "select * from code";//code"; OleDbConnection connCubrid = new OleDbConnection(connString); OleDbDataAdapter adapter = new OleDbDataAdapter(strSql, connCubrid); DataTable dt = new DataTable(); adapter.Fill(dt); Console.WriteLine(dt); DisplayData(dt); connCubrid.Close(); }
        Show
        cn15800 谢韦华[Bert] added a comment - fixed,result: S_NAME = X F_NAME = Mixed ============================ S_NAME = W F_NAME = Woman ============================ S_NAME = M F_NAME = Man ============================ S_NAME = B F_NAME = Bronze ============================ S_NAME = S F_NAME = Silver ============================ S_NAME = G F_NAME = Gold ============================ 请按任意键继续. . . test case: static public void AdapterInit_File_DataTable1() { string strSql = "select * from code";//code"; OleDbConnection connCubrid = new OleDbConnection(connString); OleDbDataAdapter adapter = new OleDbDataAdapter(strSql, connCubrid); DataTable dt = new DataTable(); adapter.Fill(dt); Console.WriteLine(dt); DisplayData(dt); connCubrid.Close(); }
        Hide
        cn15800 谢韦华[Bert] added a comment -

        if (*ppRowset)
        pRowset->InitFromCommand(m_hReq,result_count, bIsAsyncExec);

        The input parameter is wrong:

        pRowset->InitFromCommand(m_hReq, uCodepage,result_count, bIsAsyncExec);

        Show
        cn15800 谢韦华[Bert] added a comment - if (*ppRowset) pRowset->InitFromCommand(m_hReq,result_count, bIsAsyncExec); The input parameter is wrong: pRowset->InitFromCommand(m_hReq, uCodepage,result_count, bIsAsyncExec);
        Hide
        guorui 郭瑞 added a comment -

        OS:Windows7 32-bit
        .Net Framework: 3.5
        Test Result: pass

        Show
        guorui 郭瑞 added a comment - OS:Windows7 32-bit .Net Framework: 3.5 Test Result: pass

          People

          • Assignee:
            cn15800 谢韦华[Bert]
            Reporter:
            guorui 郭瑞
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: