Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.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
WPF:是否保存要访问的图像?怎样?_Wpf_Vb.net_Image_Ms Access_Adodb - Fatal编程技术网

WPF:是否保存要访问的图像?怎样?

WPF:是否保存要访问的图像?怎样?,wpf,vb.net,image,ms-access,adodb,Wpf,Vb.net,Image,Ms Access,Adodb,我的浏览按钮有这样的代码 'Dim dlg As New Microsoft.Win32.OpenFileDialog() ........................ Dim result? As Boolean = dlg.ShowDialog() If result = True Then Dim filename As String = dlg.FileName

我的浏览按钮有这样的代码

'Dim dlg As New Microsoft.Win32.OpenFileDialog() ........................ Dim result? As Boolean = dlg.ShowDialog() If result = True Then Dim filename As String = dlg.FileName brand_img.Source = New BitmapImage(New Uri(filename)) tpath.Text = filename End If '将dlg设置为新的Microsoft.Win32.OpenFileDialog() ........................ 结果如何?As Boolean=dlg.ShowDialog() 如果结果=真,则 Dim文件名为String=dlg.filename brand_img.Source=新位图图像(新Uri(文件名)) tpath.Text=文件名 如果结束 然后我想将该图像保存到我的数据库中。怎么可能呢?谢谢你的帮助。我有一个像这样的保存按钮

cn.ConnectionString = "Provider=Microsoft.Ace.Oledb.12.0; Data Source=" & My.Application.Info.DirectoryPath.ToString() & "\mvdata.accdb;" cn.Open() If rs.State = True Then rs.Close() rs.Open("Select * from company", cn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic) If textbrname.Text = "" Or textbrdesc.Text = "" Then terr.Foreground = Brushes.Red terr.Text = "Please make sure that fields are not empty." Else rs.AddNew() rs("comp_imp").Value = ??????? rs("comp").Value = textbrname.Text rs("comp_desc").Value = textbrdesc.Text rs.Update() End If rs.Close() cn.Close() cn.ConnectionString=“Provider=Microsoft.Ace.Oledb.12.0;数据源=“&My.Application.Info.DirectoryPath.ToString()&”\mvdata.accdb;” cn.Open() 如果rs.State=True,则rs.Close() rs.Open(“从公司选择*”,cn,ADODB.CursorTypeEnum.adOpenDynamic,ADODB.LockTypeEnum.adlockoptimize) 如果textbrname.Text=“”或textbrdesc.Text=“”,则 地面前景=画笔红色 terr.Text=“请确保字段不为空。” 其他的 R.AddNew() 卢比(“复合进口”)。价值=??????? rs(“comp”).Value=textbrname.Text rs(“comp_desc”).Value=textbrdesc.Text rs.更新() 如果结束 rs.Close() cn.Close() 再次感谢您的帮助…


这是一个将图像存储在数据库中的简单程序。这可能对您有所帮助,

Amrit。你的例子很清楚!这对我有很大帮助。这很干净,也很容易理解非常感谢你!