比如
byte[])reader["zp"]爲空
只要加層判斷即可
- if (reader["zp"] != DBNull.Value)
- {
- MemoryStream ms = new MemoryStream((byte[])reader["zp"]);
- Image imageBlob = Image.FromStream(ms, true);
- pictureBox1.Image = imageBlob;
- }
- else
- {
- pictureBox1.ImageLocation = "";
- }
this.richTextBox2.SelectionStart=this.richTextBox2.Text.Length; this.richTextBox2.ScrollToCaret();
public partial class MyMessageBox : Window { public static void Show(string strErrorInfo) {