医药CRM系统开发

自已做医药CRM系统有四年了,终于可以算个产品了,努力市场化,今年重种将医药营销的理念加入CRM

导航

填充DropDownListBox一般代码,代码在窗体中,不太好

Posted on 2007-02-28 10:07  hhq80  阅读(144)  评论(0编辑  收藏  举报

                SqlCommand com = new SqlCommand("select ID,Name from ResourceType ORDER BY name");
                com.Connection = conn;
                if (conn.State != ConnectionState.Open)
                    conn.Open();

                SqlDataReader dr = com.ExecuteReader();
                lstResourceTypeID.DataSource = dr;
                lstResourceTypeID.DataValueField = "id";
                lstResourceTypeID.DataTextField = "name";
                lstResourceTypeID.DataBind();
                lstResourceTypeID.SelectedIndex = 0;
                dr.Close();