点滴积累,融会贯通

-----喜欢一切有兴趣的东西

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

需要先下载mysqlnet.exe,安装后引用CoreLab.MySql.dll

基本语句

insert into `mis`.`users`  ( name, age) values ( "ywm", 13)

select id, name, age from `mis`.`users` limit 0, 50

delete from `mis`.`users` where id > 8

update `mis`.`users` set name = "ywm1" where id = 13

连接字符串

MySqlConnection conn = new MySqlConnection("User Id=root;Password=sa;Host=localhost;Database=mis;");
conn.Open();
MySqlDataAdapter da = new MySqlDataAdapter("select id, name, age from `mis`.`users` ",conn);
DataSet ds = new DataSet();
da.Fill(ds,"users");
conn.Close();
DataGrid1.DataSource= ds;
DataGrid1.DataBind();

posted on 2006-02-15 15:25  小寒  阅读(1088)  评论(0编辑  收藏  举报