如何检索longblob格式

时间:2013-02-23 03:42:54

标签: c# asp.net mysql

我应该如何显示长blob格式?
我想用c#检索MYSQL中的“content”longblob格式。

    string MyConnectionString = "Server=localhost;Database=newsborad;Uid=root;Pwd=root;"; 

    //this is the connection with the MYSQL
    MySqlConnection conn = new MySqlConnection(MyConnectionString); //communicate MYSQL
    MySqlCommand cmd = conn.CreateCommand();
    conn.Open();
    //content is longblob format in MYSQL
    cmd.CommandText = "Select content from message where msg_id = @id";
    cmd.Parameters.AddWithValue("@id", "1");

    while (reader.Read())
    {
        //how i should code?
    }
    conn.Close();

0 个答案:

没有答案