byte[] pa_img = (byte[])Customer_Function.Customer_Operation.Show_Customer_Image(Convert.ToInt32(this.dataGridView_ShowData.CurrentRow.Cells[0].Value )).Rows[0][0]; my Error Here
public static DataTable Show_Customer_Image(int MyId) { DataTable dt = new DataTable(); SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@Parameter_Id_FromForm", SqlDbType.Int); p[0].Value = MyId; ob.open(); dt = ob.Reader("Show_Customer_Image", p); ob.close(); return dt; } private void btn_Edit_Click(object sender, EventArgs e) { Add_New_FORM add_New_FORM = new Add_New_FORM(); add_New_FORM.btn_Add.Visible = false; add_New_FORM.btn_Delete.Visible = false; add_New_FORM.ID_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[0].Value.ToString(); add_New_FORM.Name_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[1].Value.ToString(); add_New_FORM.phone_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[2].Value.ToString(); add_New_FORM.kind_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[3].Value.ToString(); add_New_FORM.textBox4.Text = this.dataGridView_ShowData.CurrentRow.Cells[4].Value.ToString(); add_New_FORM.FirstDate_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[5].Value.ToString(); add_New_FORM.End_Date.Text = this.dataGridView_ShowData.CurrentRow.Cells[6].Value.ToString(); add_New_FORM.Cost_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[7].Value.ToString(); add_New_FORM.Paid_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[8].Value.ToString(); add_New_FORM.remain_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[9].Value.ToString(); add_New_FORM.NotesAboutTRAINING_TextBox.Text = this.dataGridView_ShowData.CurrentRow.Cells[10].Value.ToString(); byte[] pa_img = (byte[])Customer_Function.Customer_Operation.Show_Customer_Image(Convert.ToInt32(this.dataGridView_ShowData.CurrentRow.Cells[0].Value )).Rows[0][0]; MemoryStream ms = new MemoryStream(pa_img); add_New_FORM.pictureBox_ForTRAINER.Image = Image.FromStream(ms); add_New_FORM.ShowDialog(); }
Show_Customer_Image
DataTable
Rows[0][0]
byte
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)