Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# DataGrid ASP.net C中的中Blob#_C#_Asp.net_Mysql_Datagrid_Dataset - Fatal编程技术网

C# DataGrid ASP.net C中的中Blob#

C# DataGrid ASP.net C中的中Blob#,c#,asp.net,mysql,datagrid,dataset,C#,Asp.net,Mysql,Datagrid,Dataset,我目前正在尝试使用ASP.net C#中的DataGrid组件显示MySQL数据库表中的数据 它显示所有int和varchar格式的列,但有一列是只包含文本的mediumblob格式 我使用以下命令将DataGrid绑定到MySQL表中的数据集 public void loadGrid(string query, GridView tblGrid) { using (DatabaseWork db = new DatabaseWork()) {

我目前正在尝试使用ASP.net C#中的DataGrid组件显示MySQL数据库表中的数据

它显示所有int和varchar格式的列,但有一列是只包含文本的mediumblob格式

我使用以下命令将DataGrid绑定到MySQL表中的数据集

public void loadGrid(string query, GridView tblGrid)
    {
        using (DatabaseWork db = new DatabaseWork())
        {
            using (MySqlCommand cmd = new MySqlCommand(query, db.conn))
            {
                using (MySqlDataAdapter da = new MySqlDataAdapter(cmd))
                {

                    DataSet ds = new DataSet();
                    da.Fill(ds);
                    tblGrid.DataSource = ds.Tables[0];
                    tblGrid.DataBind();
                }

            }
        }
由于某些原因,媒体blob永远不会显示,也不会引发异常


感谢您提供的帮助。

您需要先处理BLOB。要获得一些帮助,请查看以下内容:
法兰西斯·吉尔伯特。看了这篇文章,我觉得它更有意义,因为我只想将文本存储在字段is to字段TINYTEXT而不是TINYBLOB中。这样做可以修复datagrid