问题:
在vc#环境下,一个select语句对一个表tab1进行操作,返回一个bool值(或者返回一个int值),怎么实现?着急!!!!!1!
参考代码(请修改)如下:
OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\db1.mdb");
aConnection.Open();
OleDbCommand aCommand = new OleDbCommand("select tel from telnumber where tel = 'strn3' ", aConnection);
int nn = aCommand.ExecuteNonQuery();
if (nn==0)
{
。
}
在vc#环境下,一个select语句对一个表tab1进行操作,返回一个bool值(或者返回一个int值),怎么实现?着急!!!!!1!
参考代码(请修改)如下:
OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\db1.mdb");
aConnection.Open();
OleDbCommand aCommand = new OleDbCommand("select tel from telnumber where tel = 'strn3' ", aConnection);
int nn = aCommand.ExecuteNonQuery();
if (nn==0)
{
。
}
解决方案 »
- 从数据库查询pdf问题
- .net web用户控件 超简单的问题
- -=是什么意思
- 飞信可以开发二次开发吗 或者 开发相近的程序
- 检索COM类工厂中CLSID为{000209FF-0000-0000-C000-000000000046}的组件时失败,原因是出现以下错误: 80070005
- windows application 应该如何配置sql 数据库权限
- visual studio 2008 的问题
- 关于 office word 开发中的一个问题
- 我的是Vs2008 上传图片和你一样的问题
- 怎么把数据源都遍历出来?还有数据源中的所有数据库?如何遍历?
- 请问,怎么在程序里面备份Sql 2000数据库呢~
- 如何取消重绘???
OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\db1.mdb");
aConnection.Open();
OleDbCommand aCommand = new OleDbCommand("select tel from telnumber where tel = 'strn3' ", aConnection);
aConnection.open();
int nn = Convert.toint32(aCommand.ExecuteNonQuery());
aConnection.close();
if (nn>0)
{
return true;
}
else
return false;
catch
{
return false;
}