VC++2005中如何获取SQLserver2000的返回结果

yeardan 2008-12-10 11:59:54
public: static String^ MySQLConnectionString= L"Data Source=(local);Initial Catalog=DBCommunity;Integrated Security=True";
String^ MySQL = "Select * From 小区信息 Where 优先级=1";
SqlConnection^ MyConnection = gcnew SqlConnection(MySQLConnectionString);//连接数据库
MyConnection->Open();//打开连接
System::Data::DataTable^ MyTable = gcnew System::Data::DataTable //在内存中创建一张数据表
SqlDataAdapter^ MyAdapter = gcnew SqlDataAdapter(MySQL, MyConnection);
MyAdapter->Fill(MyTable);


数据库DBCommunity里有小区信息表,该怎么样从程序里判断 这表里是否有 优先级=1 的条目,判断出来的结果怎么获得?
麻烦程序高手看看上述的解释对不对,非常感谢各位大侠的赐教!
...全文
83 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧