⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bind_drpdownlist.cs

📁 一个很好的商品销售系统,能广泛应用于大学生毕业论文设计,用java开发出来的
💻 CS
字号:
using System;
using System.Data.SqlClient;
using System.Data;

namespace Super_Market
{
	/// <summary>
	/// bind_DrpDownList 的摘要说明。
	/// </summary>
	public class bind_DrpDownList
	{
		public bind_DrpDownList(string sql,System.Web.UI.WebControls.DropDownList DropDownList)
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
			SqlConnection Conn;
			Conn=new SqlConnection("server=localhost;database=MyTest;uid=sa;pwd=''");
			String strSQL = sql;
			SqlCommand Comm = new SqlCommand(strSQL,Conn);
			SqlDataAdapter da = new SqlDataAdapter();
			Conn.Open();
			da.SelectCommand = Comm;
			DataSet ds = new DataSet();
			da.Fill(ds,"grade");
			DropDownList.DataSource = ds.Tables["grade"].DefaultView;
			DropDownList.DataTextField="TYPE_NAME"; 
			DropDownList.DataBind();
			Conn.Close();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -