System.Data.OleDb.OleDbException: 至少一个参数没有被指定值.
OleDbConnectionconn=newOleDbConnection(connectionStr);conn.Open();stringzprice=null;s...
OleDbConnection conn = new OleDbConnection(connectionStr);
conn.Open();
string zprice = null;
string cname = Session["cname"].ToString();
string sql = "SELECT SUM(gsprice) AS zj FROM cart WHERE csname=" + cname;
OleDbCommand cmd = new OleDbCommand(sql, conn);
OleDbDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
zprice = reader["zj"].ToString();
}
reader.Close();
conn.Close();
Label1.Text = zprice.ToString();
Session["zj"] = zprice; 展开
conn.Open();
string zprice = null;
string cname = Session["cname"].ToString();
string sql = "SELECT SUM(gsprice) AS zj FROM cart WHERE csname=" + cname;
OleDbCommand cmd = new OleDbCommand(sql, conn);
OleDbDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
zprice = reader["zj"].ToString();
}
reader.Close();
conn.Close();
Label1.Text = zprice.ToString();
Session["zj"] = zprice; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |