Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.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
Asp.net 在数据库中插入音频文件时出错_Asp.net_Database_C# 4.0 - Fatal编程技术网

Asp.net 在数据库中插入音频文件时出错

Asp.net 在数据库中插入音频文件时出错,asp.net,database,c#-4.0,Asp.net,Database,C# 4.0,嗯,上面的代码不起作用(数据-二进制数据类型) 有人知道tat代码中有什么错误吗?那么错误是什么?还有在什么地方?你应该这样写,参数名看看这里,知道怎么做:sry,我用词不对,上面的代码捕获了异常(不起作用)只需检查MSDN链接中的示例,了解如何使用参数值etcthnks yaar,它起作用:) str = "INSERT INTO reg (Name,ContentType,Data) values (?,?,?)" Try cmd = New Ole

嗯,上面的代码不起作用(数据-二进制数据类型)


有人知道tat代码中有什么错误吗?那么错误是什么?还有在什么地方?你应该这样写,参数名看看这里,知道怎么做:sry,我用词不对,上面的代码捕获了异常(不起作用)只需检查MSDN链接中的示例,了解如何使用参数值etcthnks yaar,它起作用:)
 str = "INSERT INTO reg (Name,ContentType,Data) values (?,?,?)"
        Try
            cmd = New OleDbCommand(str, dbcon)
            cmd.Parameters.AddWithValue("Name", "chillax")
            cmd.Parameters.AddWithValue("ContentType", "audio")
            cmd.Parameters.AddWithValue("Data",     System.IO.File.ReadAllBytes("E:\chillax.wav"))
            cmd.ExecuteNonQuery()
            MsgBox("inserted")
        Catch ex As Exception
            MsgBox("notWorking")
        End Try