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

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();
            }
        }
    }
}
 
 
 
 
 
posted @ 2016-03-17 17:09  过错  阅读(228)  评论(0编辑  收藏  举报