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


C# OracleDataAdapter.Fill方法代码示例

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


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

示例1: ExecuteDataset

 /// <summary>
 /// 
 /// </summary>
 /// <param name="commandType"></param>
 /// <param name="commandText"></param>
 /// <param name="commandParameters"></param>
 /// <param name="ds"></param>
 /// <param name="tableName"></param>
 /// <returns></returns>
 public override DataSet ExecuteDataset(CommandType commandType, string commandText,
                                        QueryParameterCollection commandParameters, DataSet ds, string tableName)
 {
     try
     {
         var cmd = new OracleCommand();
         PrepareCommand(cmd, commandType, commandText, commandParameters);
         var adapter = new OracleDataAdapter(cmd);
         if (Equals(tableName, null) || (tableName.Length < 1))
         {
             adapter.Fill(ds);
         }
         else
         {
             adapter.Fill(ds, tableName);
         }
         base.SyncParameter(commandParameters);
         cmd.Parameters.Clear();
         return ds;
     }
     catch
     {
         if (trans != null)
         {
             RollbackTransaction();
         }
         throw;
     }
     finally
     {
         Close();
     }
 }
开发者ID:CSharpDev,项目名称:Dev.All,代码行数:42,代码来源:OracleDataAccess.cs

示例2: DeckIsRefD

        public static bool DeckIsRefD(int Deck_id)
        {
            try
            {
                OracleConnection OraCon = new OracleConnection("Data Source=oids;User ID=plm;Password=123!feed;Unicode=True");
                OraCon.Open();

                OracleDataAdapter OrclPrjAdapter = new OracleDataAdapter();
                OracleCommand OrclPrjCmd = OraCon.CreateCommand();
                OrclPrjAdapter.SelectCommand = OrclPrjCmd;
                OrclPrjCmd.CommandText = @"SELECT T.TABLE_NAME,T.COLUMN_NAME FROM use_deckid_tables_view T";
                DataSet Mydata = new DataSet();
                OrclPrjAdapter.Fill(Mydata);
                DataSet tmpData = new DataSet();
                string QueryPrjIdCmdStr = string.Empty;
                for (int i = 0; i < Mydata.Tables[0].Rows.Count; i++)
                {
                    QueryPrjIdCmdStr = @"SELECT T." + Mydata.Tables[0].Rows[i][1] + " FROM " + Mydata.Tables[0].Rows[i][0] + " T WHERE TO_CHAR(T." + Mydata.Tables[0].Rows[i][1] + ")=TO_CHAR(" + Deck_id + ")";
                    OrclPrjCmd.CommandText = QueryPrjIdCmdStr;
                    OrclPrjAdapter.Fill(tmpData);
                    if (tmpData.Tables[0].Rows.Count > 0)
                        return true;
                }

                return false;
            }
            catch (Exception err)
            {
                System.Console.WriteLine(err.Message);
                return true;
            }
        }
开发者ID:freudshow,项目名称:raffles-codes,代码行数:32,代码来源:Program.cs

示例3: BuscaDGV

 public static void BuscaDGV(DataGridView dgv, String nome)
 {
     OracleDataAdapter da = new OracleDataAdapter("SELECT ingredienteid, nome, preco, estoque, descricao FROM ingredientes WHERE nome LIKE '" + nome + "%'", ConexaoOracle.ObterConexao());
     DataTable dt = new DataTable();
     da.Fill(dt);
     dgv.DataSource = dt;
 }
开发者ID:UCLINF-20152-PI1,项目名称:Beta,代码行数:7,代码来源:IngredienteDAO.cs

示例4: ddlCampus_SelectedIndexChanged

        protected void ddlCampus_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                using (OracleConnection sqlConn = new OracleConnection(DatabaseManager.CONNECTION_STRING))
                {
                    using (OracleCommand sqlCmd = new OracleCommand())
                    {
                        sqlCmd.CommandText = "select * from TB_FACULTY where CAMPUS_ID = " + ddlCampus.SelectedValue;
                        sqlCmd.Connection = sqlConn;
                        sqlConn.Open();
                        OracleDataAdapter da = new OracleDataAdapter(sqlCmd);
                        DataTable dt = new DataTable();
                        da.Fill(dt);
                        ddlFaculty.DataSource = dt;
                        ddlFaculty.DataValueField = "FACULTY_ID";
                        ddlFaculty.DataTextField = "FACULTY_NAME";
                        ddlFaculty.DataBind();
                        sqlConn.Close();

                        ddlFaculty.Items.Insert(0, new ListItem("--กรุณาเลือกสำนัก / สถาบัน / คณะ--", "0"));
                        ddlDivision.Items.Clear();
                        ddlDivision.Items.Insert(0, new ListItem("--กรุณาเลือกกอง / สำนักงานเลขา / ภาควิชา--", "0"));
                        ddlWorkDivision.Items.Clear();
                        ddlWorkDivision.Items.Insert(0, new ListItem("--กรุณาเลือกงาน / ฝ่าย--", "0"));
                    }
                }
            }
            catch { }
        }
开发者ID:OAT-TUU-TANG-FIRST,项目名称:RMUTTO,代码行数:30,代码来源:INSG_Qualified.aspx.cs

示例5: stdnt_payment_info_btn_Click

        private void stdnt_payment_info_btn_Click(object sender, EventArgs e)
        {
            dbConnect conObj = new dbConnect();
            OracleConnection conn = conObj.connFunc();
            OracleParameter parOut = new OracleParameter();

            parOut.ParameterName = "res_cur";
            parOut.OracleType = OracleType.Cursor;
            parOut.Size = 32;
            parOut.Direction = System.Data.ParameterDirection.Output;

            OracleCommand cmd = conn.CreateCommand();
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.CommandText = "student_payment_procedure";
            cmd.Parameters.Add(parOut);

            conn.Open();

            OracleDataAdapter adapter = new OracleDataAdapter(cmd);
            DataSet myset = new DataSet("res_cur");
            adapter.Fill(myset);
            stdnt_payment_dataGridView.DataSource = myset;
            stdnt_payment_dataGridView.DataSource = myset.Tables[0];

            conn.Close();
        }
开发者ID:nixon1333,项目名称:oracleCSharpDemoProject,代码行数:26,代码来源:Form3.cs

示例6: Query

 /// <summary>
 /// ִ�в�ѯ��䣬����DataSet
 /// </summary>
 /// <param name="SQLString">��ѯ���</param>
 /// <returns>DataSet</returns>
 public static DataSet Query(string SQLString)
 {
     if (SQLString != null && SQLString.Trim() != "")
     {
         using (OracleConnection connection = new OracleConnection(connectionString))
         {
             DataSet ds = new DataSet();
             try
             {
                 connection.Open();
                 OracleDataAdapter command = new OracleDataAdapter(SQLString, connection);
                 command.Fill(ds, "ds");
             }
             catch (System.Data.OracleClient.OracleException ex)
             {
                 throw new Exception(ex.Message);
             }
             finally
             {
                 connection.Close();
             }
             return ds;
         }
     }
     else
     {
         return null;
     }
 }
开发者ID:hijushen,项目名称:WindowDemo,代码行数:34,代码来源:OracleHelper.cs

示例7: bookingsDetails

        //Filling the booking details into the return cars datagridview
        public void bookingsDetails(DataGridView grd_Bookings)
        {
            var tomorrow = DateTime.Today.AddDays(1).ToString("dd-MMM-yyyy");
                var dueDate = DateTime.Today.AddDays(-5).ToString("dd-MMM-yyyy");

                string query_String = string.Format("SELECT DISTINCT B.Customer_Id ,Forename, Surname ,B.Car_Reg ,Cost ,Customer_Type,Return_Date FROM Cars CA, " +
                                       "Customers C JOIN Bookings B ON C.Customer_Id = B.Customer_Id " +
                                       "WHERE  Car_Status = 'U' AND CA.Car_Reg = B.Car_Reg AND Return_Date BETWEEN '{0}' AND '{1}'", dueDate, tomorrow );

               // MessageBox.Show(query_String);

                try
                {
                    connection.Open();

                    cmd = connection.CreateCommand();
                    cmd.CommandText = query_String;
                    data_Adapter = new OracleDataAdapter(cmd);
                    data_Set = new DataSet();
                    data_Adapter.Fill(data_Set, "Bookings");
                    grd_Bookings.DataSource = data_Set.Tables["Bookings"];
                    data_reader = cmd.ExecuteReader();//the reader is used to read in the required record
                    data_reader.Read();

                    connection.Close();
                }
                catch (Exception ex) {MessageBox.Show("" + ex);}
        }
开发者ID:pafennell,项目名称:SoftwareEngineering,代码行数:29,代码来源:Rental_Querys.cs

示例8: EditStudentFrm_Load

        private void EditStudentFrm_Load(object sender, EventArgs e)
        {
            //Author: Niall Stack - t00174406
            string CloudDB = "Data Source=cp3dbinstance.c4pxnpz4ojk8.us-east-1.rds.amazonaws.com:1521/cp3db;User Id=sw4;Password=sw4;";
            try
            {
                OracleConnection conn = new OracleConnection(CloudDB);

                OracleCommand cmd = new OracleCommand("SELECT * FROM Students", conn);

                cmd.CommandType = CommandType.Text;

                OracleDataAdapter da = new OracleDataAdapter(cmd);

                DataSet ds = new DataSet();

                da.Fill(ds, "ss");

                studGrd.DataSource = ds.Tables["ss"];

                conn.Close();
            }
            catch (OracleException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
开发者ID:niallstack,项目名称:DBProjectPlayground,代码行数:27,代码来源:EditStudentFrm.cs

示例9: button1_Click

 private void button1_Click( object sender, EventArgs e )
 {
     try
     {
         OracleConnection conn = ConnectionOracle.creaConnection();
         string str ="";
         if (radioButton1.Checked)
         {
             str = "select * from book where bname='" + textBox1.Text + "'";
         }
         if (radioButton2.Checked)
         {
             str = "select * from book where auther = '" + textBox1.Text + "'";
         }
         if (radioButton3.Checked)
         {
             str = "select * from book where pkey='"+textBox1.Text+"' or pkey1='"+textBox1.Text+"' or pkey2='"+textBox1.Text+"'";
         }
         OracleCommand cmd = conn.CreateCommand();
         OracleDataAdapter da = new OracleDataAdapter(str,conn);
         DataSet ds = new DataSet();
         da.Fill(ds);
         dataGridView1.DataSource =
             ds.Tables[0];
         conn.Open();
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
         throw;
     }
 }
开发者ID:GZC201314,项目名称:C-,代码行数:32,代码来源:Query.cs

示例10: BuscaDGV

 public static void BuscaDGV(DataGridView dgv, String nome)
 {
     OracleDataAdapter da = new OracleDataAdapter("SELECT bairroid, nome, valor FROM bairros WHERE nome LIKE '" + nome + "%'", ConexaoOracle.ObterConexao());
     DataTable dt = new DataTable();
     da.Fill(dt);
     dgv.DataSource = dt;
 }
开发者ID:UCLINF-20152-PI1,项目名称:Beta,代码行数:7,代码来源:BairroDAO.cs

示例11: ExecuteDataTable

        public static DataTable ExecuteDataTable(string connectionString, CommandType cmdType, string cmdText, params OracleParameter[] commandParameters)
        {
            using (OracleConnection connection = new OracleConnection(connectionString))
            {
                OracleCommand cmd = new OracleCommand();

                try
                {
                    PrepareCommand(cmd, connection, null, cmdType, cmdText, commandParameters);
                    OracleDataAdapter MyAdapter = new OracleDataAdapter();
                    MyAdapter.SelectCommand = cmd;
                    DataSet ds = new DataSet();
                    MyAdapter.Fill(ds);
                    cmd.Parameters.Clear();
                    DataTable table = ds.Tables[0];
                    ds.Dispose();
                    connection.Close();
                    return table;
                }
                catch
                {
                    connection.Close();
                    throw;
                }
            }
        }
开发者ID:piaolingzxh,项目名称:Justin,代码行数:26,代码来源:OracleHelper.cs

示例12: ddlAmphur_SelectedIndexChanged

        protected void ddlAmphur_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                using (OracleConnection sqlConn = new OracleConnection(DatabaseManager.CONNECTION_STRING))
                {
                    using (OracleCommand sqlCmd = new OracleCommand())
                    {
                        sqlCmd.CommandText = "select * from TB_DISTRICT where AMPHUR_ID=:DISTRICT_ID";
                        sqlCmd.Parameters.Add(":DISTRICT_ID", ddlAddressAmphurCondition.SelectedValue);
                        sqlCmd.Connection = sqlConn;
                        sqlConn.Open();
                        OracleDataAdapter da = new OracleDataAdapter(sqlCmd);
                        DataTable dt = new DataTable();
                        da.Fill(dt);
                        ddlAddressDistrictCondition.DataSource = dt;
                        ddlAddressDistrictCondition.DataValueField = "DISTRICT_ID";
                        ddlAddressDistrictCondition.DataTextField = "DISTRICT_TH";
                        ddlAddressDistrictCondition.DataBind();
                        sqlConn.Close();

                        ddlAddressDistrictCondition.Items.Insert(0, new ListItem("--กรุณาเลือก ตำบล--", "0"));

                    }
                }
            }
            catch { }
        }
开发者ID:OAT-TUU-TANG-FIRST,项目名称:RMUTTO,代码行数:28,代码来源:PersonReport.aspx.cs

示例13: BuscaDGV

 public static void BuscaDGV(DataGridView dgv)
 {
     OracleDataAdapter da = new OracleDataAdapter("SELECT usuarioid, funcionarioid, nome, ativo FROM usuarios order by usuarioid", ConexaoOracle.ObterConexao());
     DataTable dt = new DataTable();
     da.Fill(dt);
     dgv.DataSource = dt;
 }
开发者ID:UCLINF-20152-PI1,项目名称:Beta,代码行数:7,代码来源:UsuarioDAO.cs

示例14: AddTicket

        public AddTicket()
        {
            InitializeComponent();
            if (conn.State != ConnectionState.Open)
            {
                conn.Open();
            }
            OracleDataAdapter da = new OracleDataAdapter();
            da.SelectCommand = new OracleCommand();
            DataTable dt = new DataTable();
            da.SelectCommand.Connection = conn;
            string SQLquery = "select ReservationNumber from Reservation";
            da.SelectCommand.CommandText = SQLquery;
            da.Fill(dt);
            resNum_comboBox.DataSource = dt;
            resNum_comboBox.DisplayMember = "ReservationNumber";

            OracleDataAdapter da2 = new OracleDataAdapter();
            da2.SelectCommand = new OracleCommand();
            DataTable dt2 = new DataTable();

            da2.SelectCommand.Connection = conn;
            SQLquery = "select screendate, roomnumber from Screen";
            da2.SelectCommand.CommandText = SQLquery;
            da2.Fill(dt2);
            dataGridView1.DataSource = dt2;
        }
开发者ID:estefania2812,项目名称:CinemaProject,代码行数:27,代码来源:AddTicket.cs

示例15: GetDateSet

 public DataSet GetDateSet(string sqlstring)
 {
     OracleDataAdapter sda = new OracleDataAdapter(sqlstring, conn);
     DataSet ds = new DataSet();
     sda.Fill(ds, "ds");
     return ds;
 }
开发者ID:dalinhuang,项目名称:elink-mms,代码行数:7,代码来源:OraclelHelper.cs


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