首頁 >資料庫 >mysql教程 >MySQL基本语句和连接字符串_MySQL

MySQL基本语句和连接字符串_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-06-01 14:05:17945瀏覽

mysql字符串MySQL语句

需要先下载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();

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn