ITPub博客

首页 > 数据库 > > CUBRID学习笔记 39 net使用dataset 返回查询的数据

CUBRID学习笔记 39 net使用dataset 返回查询的数据

作者:LCR_ 时间:2022-04-08 11:01:23 0 删除 编辑

using CUBRID.Data.CUBRIDClient;

  
namespace DataSetExample
{
     class Program
     {
         static void Main( string [] args)
         {
             CUBRIDConnectionStringBuilder sb =  new CUBRIDConnectionStringBuilder( "localhost" ,  "demodb" ,  "public" ,  "" ,  "33000" ,  true );
             using (CUBRIDConnection conn =  new CUBRIDConnection(sb.GetConnectionString()))
             {
                 conn.Open();
 
                 string queryString =  "select * from nation order by `code` asc" ;
                 CUBRIDDataAdapter adapter =  new CUBRIDDataAdapter();
                 adapter.SelectCommand =  new CUBRIDCommand(queryString , conn);
                 DataSet nation =  new DataSet( "nation" );
                 adapter.Fill(nation);
 
                 conn.Close();
             }
         }
     }
}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70000523/viewspace-3118394/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: chatGPT vscode 体验
请登录后发表评论 登录
全部评论

注册时间:2022-02-22

  • 博文量
    1402
  • 访问量
    15001