标题:必须声明标量变量
取消只看楼主
vokansia
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2014-10-27
结帖率:0
已结贴  问题点数:20 回复次数:0 
必须声明标量变量
string mystr, mysql;
            OleDbConnection myconn = new OleDbConnection();
            OleDbCommand mycmd = new OleDbCommand();
            mystr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\\C#2010\\school.mdb";
            myconn.ConnectionString = mystr;
            myconn.Open();
            mysql = "select avg(分数) from score where 学号=@no";
            mycmd.CommandText = mysql;
            mycmd.Connection = myconn;
            mycmd.Parameters.Add("@no", OleDbType.VarChar, 5).Value = textBox1.Text;
            textBox2.Text = mycmd.ExecuteScalar().ToString();
            myconn.Close();
程序执行时报错“必须申明标量变量@no”,请高手指导
搜索更多相关主题的帖子: mysql where 
2014-10-27 22:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-437787-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.379052 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved