How add my picture from source property of image control (WPF) at Access Database?

رضا جافری 1,296 Reputation points
2020-12-17T21:03:25.813+00:00

Hi to all
First and foremost, I apologize for my grammatical errors; my first language is Persian (Iran).

First question: tell me what the data type should be to save the image in Access (2007) for example "ole object" or "memo" or another type?

Second question:how can i add/save my picture from source property of Image Control (WPF not Picture Box in Win Form) at Access Database?
I can do it with picture box control but i want do it by image control in WPF

Thanks

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,781 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. DaisyTian-1203 11,621 Reputation points
    2020-12-18T06:56:42.013+00:00

    You need to add x:FieldModifier="public" for the controls which you want to update in MemberWindow. Such as, put a lable named myLb in MemberWindow.xaml.

     <Label Name="myLb" Width="400" Height="50"  Content="This is MemberWindow!" FontSize="30" x:FieldModifier="public"></Label>   
    

    Then you can update its properties in other windows like below:

    var MW = Application.Current.Windows.OfType<MemberWindow>().SingleOrDefault();  
    MW.myLb.Content = myTxt.Text.ToString();  
    MW.myLb.Background =Brushes.Red;  
    // you can also update the MemberWindow's field   
    //MW.field1 = "test string";  
    

    By the way, if I misunderstand your question, please point out and I will pay attention for your reply.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.