asp.net进行access中数据大小的判断
stringuid=Session["userid"].ToString();stringid=Request.QueryString["id"];OleDbConnec...
string uid = Session["userid"].ToString();
string id = Request.QueryString["id"];
OleDbConnection mycon = new OleDbConnection();
mycon.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" + Server.MapPath("data/agmn.mdb");
mycon.Open();
OleDbCommand com = new OleDbCommand();
com.Connection = mycon;
com.CommandText = "select balance from [user] where userid="+uid;
OleDbDataReader mydr = com.ExecuteReader();
OleDbCommand comm = new OleDbCommand();
comm.Connection = mycon;
comm.CommandText = "select price from commodity where id=" + id;
if(comm.ToString()>=com.ToString())
{
Response.Write("<script>alert('请进行充值!')</script>");
}
我先查询出两张表的值了,一张是余额,用户的,一张是价格,商品的,怎么使他们的价格可以判断啊?我应该怎么修改? 展开
string id = Request.QueryString["id"];
OleDbConnection mycon = new OleDbConnection();
mycon.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" + Server.MapPath("data/agmn.mdb");
mycon.Open();
OleDbCommand com = new OleDbCommand();
com.Connection = mycon;
com.CommandText = "select balance from [user] where userid="+uid;
OleDbDataReader mydr = com.ExecuteReader();
OleDbCommand comm = new OleDbCommand();
comm.Connection = mycon;
comm.CommandText = "select price from commodity where id=" + id;
if(comm.ToString()>=com.ToString())
{
Response.Write("<script>alert('请进行充值!')</script>");
}
我先查询出两张表的值了,一张是余额,用户的,一张是价格,商品的,怎么使他们的价格可以判断啊?我应该怎么修改? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询