【问题标题】:WPF: Save image to access? how?WPF:保存图像以访问?如何?
【发布时间】:2013-02-16 00:06:47
【问题描述】:

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

'将 dlg 作为新的 Microsoft.Win32.OpenFileDialog() ……………………………………………………………………………… 结果暗淡?作为布尔 = dlg.ShowDialog() 如果结果 = True 那么 暗淡文件名 As String = dlg.FileName brand_img.Source = 新位图图像(新 Uri(文件名)) tpath.Text = 文件名 万一

然后我想将该图像保存在我的数据库中。怎么可能?感谢他的帮助。我有一个类似这样的保存按钮...

cn.ConnectionString = "Provider=Microsoft.Ace.Oledb.12.0; 数据源=" & My.Application.Info.DirectoryPath.ToString() & "\mvdata.accdb;" cn.Open() 如果 rs.State = True 则 rs.Close() rs.Open("Select * from company", cn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic) 如果 textbrname.Text = "" 或 textbrdesc.Text = "" 那么 terr.Foreground = Brushes.Red terr.Text = "请确保字段不为空。" 别的 rs.AddNew() rs("comp_imp").Value = ??????? rs("comp").Value = textbrname.Text rs("comp_desc").Value = textbrdesc.Text rs.Update() 万一 rs.Close() cn.Close()

再次感谢您的帮助...

【问题讨论】:

    标签: wpf vb.net image ms-access adodb


    【解决方案1】:

    http://www.sourcecodester.com/visual-basic-net/5090/phone-book-using-vbnet-ms-access-2003.html

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

    【讨论】:

    • 阿姆里特。你的例子很清楚!这对我有很大帮助。它干净而且非常容易理解。 :) 非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-08
    • 2023-03-27
    • 1970-01-01
    • 2015-11-02
    相关资源
    最近更新 更多