am getting errors in my code, kindly advice below are the required code
xaml
cs
private void Browse(object sender, RoutedEventArgs e)
{
SqlConnection cn = SqlConnection(global::DatabaseApp.Properties.Settings.Default.Database1ConnectionString);
try
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif|All Files(*.*)|*.*";
dlg.Title = "Select Student Picture";
if (dlg.ShowDialog() == DialogResult.OK)
{
imgLoc = dlg.FileName.ToString();
picStu.ImageLocation = imgLoc;
}
}
catch(Exception ex)
{
System.Windows.MessageBox.Show(ex.Message);
}
}
Thank you
Mageshwaran RPosted Nov 24, 2019, 12:18 PM
JOHN JOHNNNYPosted Apr 1, 2015, 4:49 AM
Ankur JainPosted Apr 1, 2015, 12:26 AM
please have a look on following article...
http://www.redmondpie.com/how-to-save-and-retrieve-images-in-c-wpf-application-from-sql-server-database/