首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

HTML显示下拉框的数据,该如何处理

2012-03-26 
HTML显示下拉框的数据后台怎么写将一个表中的名称,显示到HTML页面的下拉框中?[解决办法]C# codepublic sta

HTML显示下拉框的数据
后台怎么写将一个表中的名称,显示到HTML页面的下拉框中?

[解决办法]

C# code
public static DataSet GetTableName()        {            string sql = "select name from sysobjects where type = 'U' ";            SqlConnection con = new SqlConnection(_connectionString);            SqlDataAdapter dad = new SqlDataAdapter(sql, con);            DataSet dst = new DataSet();            try            {                con.Open();                dad.Fill(dst, "GetAllEmpBasicInfo");            }            catch (SqlException e)            {                // Handle exception.                throw new Exception(e.Message);            }            finally            {                con.Close();            }            return dst;        } 

热点排行