private void Btn_SQLCalistir_Click(object sender, EventArgs e) { LVw_Log_Ekle(); string Istek = RTBox_SQLYaz.Text; RTBox_SQLYaz.Clear(); RTBox_SQLYaz.Text = Istek; SonIstek = Istek; HataYeri = 0; try { if (mySQLYonet.BaglantiAc(DBHost, DBUser, DBPass, DBName)) { IstekTabloDT = new DataTable(); IstekTabloDT = mySQLYonet.IstekCalistir(Istek); //[ Güncellemede kullanmak üzere Table ve BindingSource saklayalım IstekTabloBS = new BindingSource(); IstekTabloBS.DataSource = IstekTabloDT; // Güncellemede kullanmak üzere Table ve BindingSource saklayalım ] DGV_SQLSonuc.DataSource = IstekTabloBS; DataTable Etkilenenler = new DataTable(); string Saat = DateTime.Now.ToShortTimeString(); Etkilenenler = mySQLYonet.YanSorgu("SELECT ROW_COUNT() AS Etkilenenler;"); DataRow dr = Etkilenenler.Rows[0]; string Log = DilSec.Etkilenenler + " " + dr[0].ToString(); ListViewItem LVwItemEtkilenenler = new ListViewItem(new string[] { Saat, Log }); LVw_SQLLog.Items.Insert(1, LVwItemEtkilenenler); mySQLYonet.BaglantiKapat(); } OrtakSinif.RTBox_Renklendir(RenklenecekKomutlar, RTBox_SQLYaz); TabloDuzenleAcKapaDurum = false; TabloDuzenleAcKapa(); RTBox_SQLYaz.Focus(); } catch (Exception Istisna) { OrtakSinif.HataBildir(Istisna.ToString(), Istisna); } }
private void Btn_RenkliKomutlar_Click(object sender, EventArgs e) { MySQLYonet mySQLYonet = new MySQLYonet(); string[] komutlar = mySQLYonet.IstekKomutlar(); Array.Sort(komutlar); int i = 0; RTBox_Komutlar.Text = ""; foreach (string komut in komutlar) { RTBox_Komutlar.Text += "dizi[" + i.ToString() + "] = \"" + komut + "\";\r\n"; i++; } foreach (string komut in komutlar) { //[ renklendir if (RTBox_Komutlar.Text.Contains(komut)) { int index = -1; int selectStart = RTBox_Komutlar.SelectionStart; while ((index = RTBox_Komutlar.Text.IndexOf(komut, (index + 1))) != -1 || (index = RTBox_Komutlar.Text.IndexOf(komut.ToUpper(), (index + 1))) != -1 ) { this.RTBox_Komutlar.Select((index + 0), komut.Length); this.RTBox_Komutlar.SelectionColor = Color.Aqua; //this.RTBox_Komutlar.Select(selectStart, 0); this.RTBox_Komutlar.SelectionColor = Color.Blue; } } // renklendir ] } OrtakSinif.RTBox_Renklendir(komutlar, richTextBox1); }