string strFileFullPath=Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["FileFullPath"]);
string strConn=string.Fromat("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}",strFileFullPath);
OleDbConnection oleConn=new OleDbConnection(strConn);
oleConn.Open();
OleDbCommand oleCmd=new OleDbCommand("select count(*) from Register where user_ID="+userID+" and user_Pwd="+userPwd,oleConn);
int count=Convert.ToInt32(oleCmd.ExecuteScalar());
if(count>0)1
{
Response.Write("Successed in Resgister!");
}
else
{
Response.Write("File in Resgister!");
}调试提示错误是 int count=Convert.ToInt32(oleCmd.ExecuteScalar()); 标准表达式中数据类型不匹配 该怎么改呀?
string strConn=string.Fromat("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}",strFileFullPath);
OleDbConnection oleConn=new OleDbConnection(strConn);
oleConn.Open();
OleDbCommand oleCmd=new OleDbCommand("select count(*) from Register where user_ID="+userID+" and user_Pwd="+userPwd,oleConn);
int count=Convert.ToInt32(oleCmd.ExecuteScalar());
if(count>0)1
{
Response.Write("Successed in Resgister!");
}
else
{
Response.Write("File in Resgister!");
}调试提示错误是 int count=Convert.ToInt32(oleCmd.ExecuteScalar()); 标准表达式中数据类型不匹配 该怎么改呀?
解决方案 »
- 怎么在vs2012上的metro界面的txt框里显示文件名
- StreamWriter WriteLine字体放大或加粗
- 初入C#描述设计模式,怎么样才能有所提高
- C# Windows Form,点某个按钮后,长时间运行时,如果实时显示窗口内容。
- 反射所得的类型,如何用来定义变量?
- 并发用户问题?
- GDI+画实时曲线的问题
- 如何把数值转成财务上用的用豆号隔开的金额
- 如何才能让水晶报表预览显示的效果能和WORD中显示的效果一样清楚!
- 如何用c#进行多媒体开发
- SQLState:‘01000’SQL Server错误:109一般性网络错误。请检查网络文档。
- 到底如何在另一个线程类中修改界面中的控件内容
1.你先看看这个SQL返回的结果是什么
2.int count=Convert.ToInt32(oleCmd.ExecuteScalar())改为
object ob=oleCmd.ExecuteScalar();
设置短点查看ob里是什么类容.
可是换了access就报错