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....... !!

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...