Do Not use the Data Type image because the Image will be converted into binary and will be saved so better you save the path
private void SaveImage()
{
string path = Application.StartupPath+"\\ProfessorImage\\";
string path2 = txtBrowse.Text;
try
{
if (Directory.Exists(path))
{
string filename = Path.GetFileName(path2);
path = path + filename;
File.Copy(path2, path, true);
toolStripStatusAll.Text = "Succesfully Added";
}
else
{
Directory.CreateDirectory(path);
string fileName = Path.GetFileName(path2);
path = path + fileName;
File.Copy(path2, path);
toolStripStatusAll.Text = "Succesfully Added";
}
}
catch (Exception ex)
{
toolStripStatusAll.Text = "Failed To Copy"+ex.ToString();
}
txtBrowse.Text = "";
}
Save the Image in a directory and Save the path in the DB