public void dataBind() { string sql = "select * from productType order by orderId Desc"; DataSet ds = crm.Querys(sql, null); RepList.DataSource = ds; RepList.DataBind(); }
public void InitData(string ProductId) { string sql = "select productName,orderId from productType where productTypeid=@ProductId"; SqlParameter[] Paras = new SqlParameter[] { new SqlParameter("@ProductId", SqlDbType.Int) }; Paras[0].Value = ProductId; DataSet ds = crm.Querys(sql, Paras); if (ds != null && ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; if (dt != null && dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; txtTypeName.Value = row["productName"].ToString(); txtOrder.Value = row["orderId"].ToString(); } } }