我是菜鸟哈哈,问高手们一个问题,
SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionString["BookConnectionString"].ConnectionString);
SqlCommand sc = new SqlCommand();
sc.Connection = sqlcon;
sc.CommandText = "select Sum(SumPrice) from ShopCart where UserID='" + id + "'";现在想把统计出的这个值放到一个Label(ID叫Total)里面,这句话怎么写?Total.Text = ?
SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionString["BookConnectionString"].ConnectionString);
SqlCommand sc = new SqlCommand();
sc.Connection = sqlcon;
sc.CommandText = "select Sum(SumPrice) from ShopCart where UserID='" + id + "'";现在想把统计出的这个值放到一个Label(ID叫Total)里面,这句话怎么写?Total.Text = ?
这是?
label只有caption,没有text
要写成Total.caption
sc.execute('select Sum(SumPrice) from ShopCart where UserID="'+ id + '"').fields[0].asinteger
即可了。
sc.execute('select Sum(SumPrice) from ShopCart where UserID="'+ id + '"').fields[0].asinteger
即可了。支持