private void Arama(int Pid) { try { Sorgular sorgu = new Sorgular(); string[] a = new string[11]; for (int i = 0; i < 11; i++) { a[i] = MydataGridView.Rows[Pid - 1].Cells[i].Value.ToString(); } TC_txtbox.Text = a[0]; isim_txtbox.Text = a[1]; soyisim_txtbox.Text = a[2]; if (a[3] == "E") { Cinsiyet_Cbox.SelectedIndex = 0; } else { Cinsiyet_Cbox.SelectedIndex = 1; } dateTimePicker_Dtarih.Text = a[4]; Adres_txtbox.Text = a[5]; Mail_txtbox.Text = a[6]; Tel_txtbox.Text = a[7]; string Ust; Ust = sorgu.sp_findUstUnvan(a[10]); bool bitti = false; int j = 0; int a1 = 0; int a2 = 0; int a3 = 0; while (bitti == false) { if (a1 == 0) { Meslek_Cbox.SelectedIndex = j; } if (a2 == 0) { Bolum_Cbox.SelectedIndex = j; } if (a3 == 0) { Unvan_Cbox.SelectedIndex = j; } if (Meslek_Cbox.SelectedItem.ToString() == a[8]) { if (a1 == 0) { Meslek_Cbox.SelectedIndex = j; } a1 = 1; } if (Bolum_Cbox.SelectedItem.ToString() == a[9]) { if (a2 == 0) { Bolum_Cbox.SelectedIndex = j; } a2 = 1; } if (Unvan_Cbox.SelectedItem.ToString() == Ust) { if (a3 == 0) { Unvan_Cbox.SelectedIndex = j; } a3 = 1; } if (a1 * a2 * a3 == 1) { bitti = true; } else { j++; } } j = 0; while (bitti == true) { Altu_Cbox.SelectedIndex = j; if (Altu_Cbox.SelectedItem.ToString() == a[10]) { bitti = false; } else { j++; } } } catch (Exception g) { MessageBox.Show(g.ToString(), "Hata Kod:19", MessageBoxButtons.OK, MessageBoxIcon.Error); } }