日期:2014-05-18  浏览次数:20736 次

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;
        }