社区
.NET技术其他语言
帖子详情
执行完oleDbCommand1.ExecuteReader()后
molester
2002-07-01 03:17:32
如何把找到的记录读出来?如果没有找到合适的记录,通过什么可以判断出它是空的呢?
...全文
91
2
打赏
收藏
执行完oleDbCommand1.ExecuteReader()后
如何把找到的记录读出来?如果没有找到合适的记录,通过什么可以判断出它是空的呢?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
saucer
2002-07-02
打赏
举报
回复
OleDbDataReader dr = oleDbCommand1.ExecuteReader();
while (dr.Read())
{
System.Console.WriteLine(dr.GetString(0));
}
hbxtx
2002-07-02
打赏
举报
回复
这个问题好像问过,下面代码不能解决吗?我就是这样判断的。
条件写在select语句里边
OleDbDataReader dr = oleDbCommand1.ExecuteReader();
if (dr.Read())
{
//找到
}
else
{
//没找到
}
CrystalReport1.rpt ,DataSet.xsd,crystalReportView
er
1水晶报表,以及向文本框对象传值 C# .NET FRAMEWORK 源代码 决定对您有用
OleDb
Connection Con = null; string strCon = null;
OleDb
Command
Cmd = null; strCon = "Provid
er
=Microsoft.Jet.
OLEDB
.4.0;Data Source=C:\\Documents and Settings\\Administrator\\桌面\\江大软件\\28.mdb"; Con = new
OleDb
Connection(strCon);//建立连接 string strSql = "select * from BZData wh
er
e GroupID='1214015'";//表名的写法也应注意不同,对应的excel表为sheet1,在这里要在其后加美元符号$,并用中括号 Cmd = new
OleDb
Command
(strSql, Con);//建立要
执行
的命令
OleDb
Data
Read
er
read
= null; DataSet ds = new DataSetshujuji(); try { Con.Open(); //从命令对象中读取数据
read
= Cmd.
Execute
Read
er
(); //有了ADO.NET,可把读取来的数据直接加载到数据集中 ds.Tables[0].Load(
read
);
read
.Close(); Con.Close(); //为查看器提供本地报表数据 CrystalReport1 cry = new CrystalReport1();((TextObject)cry.ReportDefinition.ReportObjects["Text12"]).Text = "sdsad"; //Paramet
er
RangeValue cry.SetDataSource(ds); crystalReportView
er
1.ReportSource = cry; } catch (Exception ex) { } } } }
Settingshezhi.settings reportView
er
1 Report1.rdlc DataSet.xsd C# .NET FRAMEWORK 源代码
OleDb
Connection Con = null; string strCon = null;
OleDb
Command
Cmd = null; strCon = "Provid
er
=Microsoft.Jet.
OLEDB
.4.0;Data Source=C:\\Documents and Settings\\Administrator\\桌面\\江大软件\\28.mdb"; Con = new
OleDb
Connection(strCon);//建立连接 string strSql = "select * from BZData wh
er
e GroupID='1214015'";//表名的写法也应注意不同,对应的excel表为sheet1,在这里要在其后加美元符号$,并用中括号 Cmd = new
OleDb
Command
(strSql, Con);//建立要
执行
的命令
OleDb
Data
Read
er
read
= null; DataSet ds = new DataSetshujuji(); try { Con.Open(); //从命令对象中读取数据
read
= Cmd.
Execute
Read
er
(); //有了ADO.NET,可把读取来的数据直接加载到数据集中 ds.Tables[0].Load(
read
);
read
.Close(); Con.Close(); //为查看器提供本地报表数据 CrystalReport1 cry = new CrystalReport1(); cry.SetDataSource(ds); crystalReportView
er
1.ReportSource = cry; } catch (Exception ex) { } this.reportView
er
1.RefreshReport(); 哈哈
访问数据库和页面跳转.doc
访问数据库和页面跳转.doc
VB.NET连接数据库方法大全.doc
对VB.net感兴趣的朋友,这是一篇很好的链接数据库的介绍哟,很有用的哟!
C#调用oracle方法(包括调用存储过程)
详细的记录了C#如何调用oracle以及带有存储过程输出变量的方法,适合初学者。
.NET技术其他语言
1,979
社区成员
12,447
社区内容
发帖
与我相关
我的任务
.NET技术其他语言
.NET技术 其他语言讨论
复制链接
扫一扫
分享
社区描述
.NET技术 其他语言讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章