I have the following code in C# WPF and when I choose no image it shows me the error message "System.ArgumentNullException: Pathe can't be null" thank u 4 ur help
FileStream fileStream = new FileStream(imgName, FileMode.Open, FileAccess.Read);
byte[] imgBytes = new byte[fileStream.Length];
if (string.IsNullOrEmpty(imgBytes.ToString()))
{
fileStream.Read(imgBytes, 0, Convert.ToInt32(fileStream.Length));
fileStream.Close();
db.SpInsProducts(txtProductName.Text.Trim(), txtPrDesc.Text.Trim(), null,
Convert.ToDateTime(lblDate.Content), PublicVariables.gUserId);
}
else
{
fileStream.Read(imgBytes, 0, Convert.ToInt32(fileStream.Length));
fileStream.Close();
db.SpInsProducts(txtProductName.Text.Trim(), txtPrDesc.Text.Trim(), imgBytes,
Convert.ToDateTime(lblDate.Content), PublicVariables.gUserId);
}