SELECT name FROM sysobjects WHERE (xtype = 'U')
sysobjects 这是系统表的表名
再有DbNameDs更本没有添加数据。
namespace ShopModel{public class Shops{string shopname double Price int number int allnumber int singlenumber public string Shopname{get { return shopname}set { shopname = value}}public double Price1{get { return Price}set { Price = value}}public int Number{get { return number}set { number = value}} public int Allnumber{get { return allnumber}set { allnumber = value}}public int Singlenumber{get { return singlenumber}set { singlenumber = value}} }}查询所有数据private static IList<Shops>Getnumber(){string sql = "select * from Shop" List<Shops>list = new List<Shops>() using(DataTable dt = DBHelper.GetDataSet(sql)){foreach(DataRow row in dt.Rows ){Shops shop = new Shops() shop.Shopname =(string)row["SpName"] shop.Number =(int)row["SpNumber"] shop.Price1 = Convert.ToDouble( row["SpPrice"]) shop.Allnumber = (int)row["SpAllnumber"] shop.Singlenumber = (int)row["Spsinglenumber"] list.Add(shop) }return list }}欢迎分享,转载请注明来源:内存溢出
评论列表(0条)