Friday, February 4, 2011

Upload a Picture in WPF UI

 Uploading Picture in UI is very Important It is Quite Easy. On upload button Event Write down The following code:

                OpenFileDialog dlg;
                FileStream fs;
               byte[] data;

              dlg = new Microsoft.Win32.OpenFileDialog();

               if (dlg.FileName == "")
                MessageBox.Show("Picture is not selected......");
                fs = new FileStream(dlg.FileName, FileMode.Open, FileAccess.Read);

                data = new byte[fs.Length];
                fs.Read(data, 0, System.Convert.ToInt32(fs.Length));

                ImageSourceConverter imgs = new ImageSourceConverter();
                SupplierLogoimage.SetValue(Image.SourceProperty, imgs.ConvertFromString(dlg.FileName.ToString()));

EnJoy....... !!

vfpoledeb.1 provider is not registered on the local machine

Have u Install VFP Ole DB Provider in your System ? If No then Please Install it from following link.