c#怎么读取mysql中 mediumtext类型的数据
如题:
C# code:
MySQLConnection con = new MySQLConnection( new MySQLConnectionString("localhost","beephpcms","root","root").AsString);
try
{
DataSet ds = new DataSet();
con.Open();
MySQLCommand cmd = new MySQLCommand("set names 'gb2312'", con);
cmd.ExecuteNonQuery();
MySQLCommand com = new MySQLCommand("select contentid as id,content from phpcms_c_news where content like '%news_%html%'", con);
MySQLDataReader mydr = com.ExecuteReaderEx();
while (mydr.Read())
{
string content = "";
string id = "";
id = mydr["id"].ToString();
content=mydr["content"].ToString();//此行报错,content是mediumtext类型数据
}
mydr.Close();
con.Close();
}
catch (Exception error)
{
MessageBox.Show(error.Message);
}
请指点如何读取mediumtext类型数据
string content = "";
mediumtext 其实本质上是BLOB, 所以用 byte[]
能再详细些吗?
stri
相关问答:
在安装Java编译器的Eclipse的时候,对环境变量进行了配置,在安装MySQl的时候也要对环境变量进行配置;那么后面的配置会影响前面的Eclipse的配置吗?
请大家多指教~!谢谢!
不会把,我这都装了的 我系统里 还装了 ......
有个winform程序,使用c#+mysql,需要在一个窗体设置mysql自动删除功能,包括自动删除多少天之前的数据以及是否开启自动删除功能,我程序退出后,还怎么控制Mysql自己删除啊?是不是要用mysql的event来实现?c#可以调用mysq ......
我的Mysql 使用的时候 用dos建立的数据表 在dos中能显示出中文
但是在 其他的可视页面 和网页中都显示乱码 如何解决?
在mysql控制台:show variables like 'char%';贴结果出来看看。
mysql命令行模式下: ......
我开发ASP.net时
插入外文乱码
SHOW VARIABLES LIKE 'character%';
这个时候
character_set_client utf8
character_set_connection utf8
character_set_database utf8
ch ......
要转成一样的效果,用powerdesigner怎么转?能转吗?
create table publishers (
publisherID int identity,
publisherName varchar (30) NOT NULL,
constraint pk_publishers primary key (publisherID)
)& ......