首页 > 编程知识 正文

c和c#和c++区别(男生说的c是什么意思)

时间:2023-05-03 12:12:05 阅读:66085 作者:3934

在查询数据库的过程中,使用方法ExecuteReader,返回的结果是MySqlDataReader,由于引用的信息错误,会绕远路进行记录;

stringconnectionstr=' server=localhost; uid=根; password=; 数据库=db _ family '; string SQL content=' select * fromt _ user '; mysqlconnectionsqlconnection=null; MySqlDataReader reader=null; try { sqlconnection=newmysqlconnection (connectionstr ); sqlConnection.Open (; mysqlcommandcommand=newmysqlcommand (SQL content,sqlConnection ); reader=command.ExecuteReader (; while(reader.read () (if ) reader.hasrows ) ) console.writeline ) reader.getint32 )0) : ) reader.getstine } finally { reader.Close (); sqlConnection.Close (; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。