当前位置: 首页>>代码示例>>C#>>正文


C# ADODB.Recordset.GetRows方法代码示例

本文整理汇总了C#中ADODB.Recordset.GetRows方法的典型用法代码示例。如果您正苦于以下问题:C# ADODB.Recordset.GetRows方法的具体用法?C# ADODB.Recordset.GetRows怎么用?C# ADODB.Recordset.GetRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ADODB.Recordset的用法示例。


在下文中一共展示了ADODB.Recordset.GetRows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: db_access

        public object[] db_access(string strSQL)
        {
            ADODB.Connection objCon;
            ADODB.Recordset objRec;
            object[,] dataRows;
            object[] dataSuite;
            string strCon;

            objCon = new ADODB.Connection();
            objRec = new ADODB.Recordset();

            //establish the connection string and open the database connection
            strCon = "driver={MySQL ODBC 5.1 Driver};server=107.22.232.228;uid=qa_people;pwd=thehandcontrols;" +
                "database=functional_test_data;option=3";

            objCon.Open(strCon);

            //execute the SQL and return the recrodset of results
            objRec = objCon.Execute(strSQL, out missing, 0);

            //populate a two dinmensional object array with the results
            dataRows = objRec.GetRows();

            //get a one dimensional array that can be placed into the Test Suite dropdown
            dataSuite = thinArray(dataRows);

            //close the recordset
            objRec.Close();

            //close the database connection
            objCon.Close();

            return dataSuite;
        }
开发者ID:modulexcite,项目名称:StudentSuccessDashboard,代码行数:34,代码来源:dbUpdater.cs

示例2: tstBrowser

        public static void tstBrowser(string pth, string datSource, string steName, string tstName, int radnum, string baseURL, ref string[,] tstResult, out int fndExcep, out int fnlFail)
        {
            testname = tstName;
            int vfyFunc;
            int eleNum;
            int maxCols;
            int stpCount;
            int itmCount;
            int tstFail;
            char chr = Convert.ToChar(34);
            object[,] tmpArray;
            string[] outArray;
            string[] lstTest;
            string[] dbArray;
            string[,] dataArray;
            string[,] rsltArray;
            string argID;
            string functionID;
            string getNeg;
            string nmFunc;
            string step;
            string strCon;
            string strSQL;
            string tstID;
            string xlPath;
            ADODB.Connection objCon;
            ADODB.Recordset objRec;
            TestSuite lstObject;

            getNeg = "";
            tstFail = 0;
            fnlFail = 0;
            fndExcep = 0;
            DateTime tmp = DateTime.Now;                            //date-time at the time of test running
            vfyFunc = 0;
            rsltArray = new string[1, 6];

            //open browser based on selection on the GUI
            tstObject tstObj = new tstObject(radnum);

            //TextFileOps.Write(pth, "<li>", 100);

            switch (datSource)
            {
                case "DB":
                {
                    //db connection string
                    strCon = "driver={MySQL ODBC 5.1 Driver};server=107.22.232.228;uid=qa_people;pwd=thehandcontrols;" +
                                "database=functional_test_data;option=3";

                    //database connections objects
                    objCon = new ADODB.Connection();
                    objRec = new ADODB.Recordset();
                    //open the connection to the database
                    objCon.Open(strCon);

                    //SQL to execute
                    strSQL = "SELECT id FROM test WHERE name = '" + tstName + "'";

                    //open recordset and get test id with SQL
                    objRec.Open(strSQL, objCon);

                    //set test id to a string variable
                    tmpArray = objRec.GetRows();
                    tstID = Convert.ToString(tmpArray[0, 0]);

                    //close the recordset
                    objRec.Close();

                    //SQL to execute
                    strSQL = "SELECT COUNT(*) FROM step WHERE test_id = '" + tstID + "'";

                    //open recordset and get the number of stepsto execute with SQL
                    objRec.Open(strSQL, objCon);

                    //get the count value from the recordset and convert to an int fpor use in the step loop
                    tmpArray = objRec.GetRows();
                    stpCount = Convert.ToInt32(tmpArray[0, 0]);

                    //close the recordset
                    objRec.Close();

                    //set up a for loop to run all steps in a test
                    for (int stp = 0; stp < stpCount; stp++)
                    {
                        if (stp == 23)
                            stp = 23;
                        step = "Step " + Convert.ToString(stp + 1);
                        //SQL to execute
                        strSQL = "SELECT function_id, argument_set_id FROM step WHERE (test_id = '" + tstID + "') AND (number = " + (stp + 1) + ")";

                        //open recordset and get all the ids necessary for this step
                        objRec.Open(strSQL, objCon);
                        tmpArray = objRec.GetRows();

                        //set the function id
                        functionID = Convert.ToString(tmpArray[0, 0]);

                        //set the hash string for the argument set
                        argID = Convert.ToString(tmpArray[1, 0]);
//.........这里部分代码省略.........
开发者ID:modulexcite,项目名称:StudentSuccessDashboard,代码行数:101,代码来源:Verify_User_Screens.cs


注:本文中的ADODB.Recordset.GetRows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。