如何使用vb.net将视频文件插入数据库并检索到数据库? [英] How to Insert and retrieve video files into database using vb.net?
本文介绍了如何使用vb.net将视频文件插入数据库并检索到数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在做MCA的最后一年.在我的项目中,我想使用VB.Net将视频文件插入数据库并从中检索视频文件.如果有人知道,请帮助我执行此项目.
Hi,
I am doing final year MCA.In my project, I want to insert and retrieve a video files into database using VB.Net.If any one known that please help me to do this project.
推荐答案
将视频存储在VarBinary
列中. 此 [
Store the video in a VarBinary
column. This[^] MSDN article explains about the usages from ADO.NET. After retrieving the value, you need to write it to disk with the correct extension.
Dim conn = New MySqlConnection()
conn.ConnectionString = "server=" & dbServer & ";" _
& "user id=" & dbUser & ";" _
& "password=" & dbpassword & ";" _
& "database=" Dim conn = New MySqlConnection()
conn.ConnectionString = "server=" & dbServer & ";" _
& "user id=" & dbUser & ";" _
& "password=" & dbpassword & ";" _
& "database=" & dbDb
Dim myCommand As New MySqlCommand
myCommand.Connection = conn
myCommand.CommandText = SQL
conn.Open()
myCommand.Parameters.AddWithValue("?fldvideoNo", id)
myCommand.Parameters.AddWithValue("??fldTopicNo", topNo)
myCommand.Parameters.AddWithValue("?File", rawdata)
myCommand.Parameters.AddWithValue("?size", filesize)
myCommand.ExecuteNonQuery()
conn.Close()
conn.Dispose()
myCommand.Dispose()& dbDb
Dim myCommand As New MySqlCommand
myCommand.Connection = conn
myCommand.CommandText = SQL
conn.Open()
myCommand.Parameters.AddWithValue("?fldvideoNo", id)
myCommand.Parameters.AddWithValue("??fldTopicNo", topNo)
myCommand.Parameters.AddWithValue("?File", rawdata)
myCommand.Parameters.AddWithValue("?size", filesize)
myCommand.ExecuteNonQuery()
conn.Close()
conn.Dispose()
myCommand.Dispose()
我可以帮助您使用C#而不是VB:d
I can help you using C# not VB :d
这篇关于如何使用vb.net将视频文件插入数据库并检索到数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文