zoukankan      html  css  js  c++  java
  • 獲取內存表中的數據

    一、DateTable  dt  = Coeno.BU.BUs.QueryBUIDInfo().Tables[0];   (命名空間名稱、類名、方法名)

           dorpBU.DateSource=dt;    (獲取對象)

           dorpBU.DateTextField=dt.Columns["BU"].ToString();    (獲取該表列的集合)

           dropBU.DataValueField = dtBU.Columns["BU"].ToString();

           dropBU.DataBind();  (數據綁定)

           dropBU.Items.Insert(0,new ListItem("ALL","ALL"));  (將指定的ListItem插入到集合指定索引的位置)

    二、 public static DataSet QueryBUIDInfo()

          {

           string sql ="SELECT * FROM BU表 where  enableflag=' " +"1"+" ' order by BU"   ;

                SqlConnection con   =  new SqlConnection (con);

                SqlDataAdapter dad = new SqlDataAdapter(sql, con);

                DataSet dst = new DataSet();

                 try

                 {

                   con.Open();

           dad.Fill(dst,"QueryBU");

                 }

        catch(SqlException e)

                 {

           throw new Exception(e.Message);

                 }

                finally

                {

          con.Close();

                }

                return  dst;

    }

    好好學習。天天向上
  • 相关阅读:
    基于ubuntu10.04的gccarm安装
    面向连接和非面向连接
    多址技术与复用技术
    NAT——网络地址转换
    IP地址与子网掩码的关系
    ISO的7层模型
    比特率与波特率的比较
    C#中GUID的使用
    iframe刷新父页面
    javascript 获取控件坐标
  • 原文地址:https://www.cnblogs.com/ximi07/p/10233435.html
Copyright © 2011-2022 走看看