private void Button2_Click(object sender, EventArgs e) { try { SaveFileDialog s = new SaveFileDialog(); s.FileName = ""; if (DataGridView1.Rows.Count == 0) { return; } DataGridView1.Focus(); s.FileName = DataGridView1[2, DataGridView1.CurrentRow.Index].Value.ToString(); s.Filter = "Files(*." + DataGridView1[4, DataGridView1.CurrentRow.Index].Value.ToString() + ")|*." + DataGridView1[4, DataGridView1.CurrentRow.Index].Value.ToString() + ""; if (s.ShowDialog() == System.Windows.Forms.DialogResult.OK) { MemoryStream sWriter = new MemoryStream((byte[])(DataTable1.Rows[DataGridView1.CurrentRow.Index]["Files"]), true); if (sWriter == null) { Interaction.Beep(); } return; } DataGridView1.ClearSelection(); } catch (Exception ex) { Button1.Enabled = true; Button2.Enabled = true; Button3.Enabled = true; Button4.Enabled = true; MessageBox.Show(ex.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)