首页 > 编程 > ASP > 正文

asp textbox获取显示mysql数据示例代码

2020-07-27 12:44:31
字体:
来源:转载
供稿:网友
复制代码 代码如下:

using MySql.Data.MySqlClient;

MySqlConnection conn = new MySqlConnection("server=(local);database=abc;uid=;pwd=");
conn.Open();
MySqlCommand com = new MySqlCommand("select * from tb_xxjj",conn);
MySqlDataReader dr = com.ExecuteReader();
dr.Read();
TB_xxjj.Text = dr["title"].ToString();
content.Text = dr["content"].ToString();
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表