Kuran-ı Kerim’de Türkçe ve Arapça Ayet bulan program — C#
Anasayfa (Arama Sayfası)
[code lang=”csharp”]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;//www.gorselprogramlama.com
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Collections;
using System.Threading;
namespace Kuran_ı_Kerim_Ayet_Bulucu
{
public partial class frmMenu : Form
{
public frmMenu()
{
InitializeComponent();
}
OleDbConnection connect = new OleDbConnection("Provider=Microsoft.Ace.OleDb.12.0;Data Source=Kuran-ı Kerim.accdb;Jet OLEDB:Database Password=qcs3swkw89;");
public ArrayList sonuclar = new ArrayList();
//www.gorselprogramlama.com
void BaglantiKur()
{
if (connect.State == ConnectionState.Closed)
{
connect.Open();
}
}
void TurkceAra()
{
BaglantiKur();
string sql = "SELECT * FROM turkce WHERE UCASE(metin) LIKE UCASE(‘%" + txtWord.Text + "%’)";
OleDbCommand cmd = new OleDbCommand(sql, connect);
OleDbDataReader oku = cmd.ExecuteReader();
while (oku.Read())
{
if (!sonuclar.Contains(oku[3].ToString()))
{
sonuclar.Add(oku[3].ToString());
}
}
connect.Close();
}//www.gorselprogramlama.com
void ArapcaAra()
{
BaglantiKur();
string sql = "SELECT * FROM arapca WHERE UCASE(metin) LIKE UCASE(‘%" + txtWord.Text + "%’)";
OleDbCommand cmd = new OleDbCommand(sql, connect);
OleDbDataReader oku = cmd.ExecuteReader();
while (oku.Read())
{
if (!sonuclar.Contains(oku[3].ToString()))
{
sonuclar.Add(oku[3].ToString());
}
}
connect.Close();
}
//www.gorselprogramlama.com
void dataGridAktar(string tablo)
{
BaglantiKur();
DataTable dt = new DataTable();
string tabloSonuc = "";
if (tablo == "tr")
{
tabloSonuc = "turkce";
}
else
{
tabloSonuc = "arapca";
}
for (int i = 0; i < sonuclar.Count; i++)
{
string sql = "SELECT * FROM " + tabloSonuc + " WHERE indis = " + Convert.ToInt32(sonuclar[i]);
OleDbDataAdapter adp = new OleDbDataAdapter(sql, connect);
adp.Fill(dt);
}
frmResult frmR = new frmResult();
frmR.dgAll.DataSource = dt;
if ((frmR.dgAll.RowCount – 1).ToString() == "-1")
{
MessageBox.Show("Hiç bir sonuç bulunamadı.","Arama Sonucu",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
else
{//www.gorselprogramlama.com
lblArama.Visible = false;
frmR.lblResult.Text = "Toplam " + (frmR.dgAll.RowCount – 1).ToString() + " adet sonuç bulundu.";
if (tablo == "tr")
{
frmR.tercumeTablosu = "arapca";
frmR.lblTercume.Text = "Latin H.:";
}
else
{
frmR.tercumeTablosu = "turkce";
frmR.lblTercume.Text = "Türkçe :";
}
frmR.ShowDialog();
}
connect.Close();
sonuclar.Clear();
}
//www.gorselprogramlama.com
private void btnFind_Click(object sender, EventArgs e)
{
txtWord.Text = txtWord.Text.Replace("’", "´");
if (txtWord.Text != "")
{
lblArama.Visible = true;
if (rbTR.Checked)
{
TurkceAra();
dataGridAktar("tr");
}
else if (rbSA.Checked)
{
ArapcaAra();
dataGridAktar("sa");
}
}
else
{
MessageBox.Show("Arama yapıcağınız kelimeyi girmediniz.","Dikkat",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
private void btnBackColor_Click(object sender, EventArgs e)
{
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
this.BackColor = colorDialog1.Color;
}
}
//www.gorselprogramlama.com
}
}
[/code]
Arama Sonucları

[code lang=”csharp”]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace Kuran_ı_Kerim_Ayet_Bulucu
{
public partial class frmResult : Form
{
public frmResult()
{
InitializeComponent();
}
OleDbConnection connect = new OleDbConnection("Provider=Microsoft.Ace.OleDb.12.0;Data Source=Kuran-ı Kerim.accdb;Jet OLEDB:Database Password=qcs3swkw89;");
public string tercumeTablosu = "";
void BaglantiKur() //www.gorselprogramlama.com
{
if (connect.State == ConnectionState.Closed)
{
connect.Open();
}
}
void bilgiAl()
{
BaglantiKur();
try
{
int sure_No = Convert.ToInt32(dgAll.CurrentRow.Cells[1].Value);
int ayet_No = Convert.ToInt32(dgAll.CurrentRow.Cells[2].Value);
string sql = "SELECT * FROM sure_isimleri WHERE sure_No=" + sure_No;
OleDbCommand cmd = new OleDbCommand(sql, connect);
OleDbDataReader oku = cmd.ExecuteReader();
while (oku.Read())
{
lblBilgi.Text = "[" + sure_No + "]. " + oku[1].ToString() + " Suresi " + ayet_No.ToString() + ". Ayet";
break;//www.gorselprogramlama.com
}
sql = "SELECT * FROM " + tercumeTablosu + " WHERE indis = " + Convert.ToInt32(dgAll.CurrentRow.Cells[3].Value.ToString());
cmd = new OleDbCommand(sql, connect);
oku = cmd.ExecuteReader();
while (oku.Read())
{
txtTercume.Text = oku[0].ToString();
break;
}
sql = "SELECT * FROM orj_kuran WHERE index = " + Convert.ToInt32(dgAll.CurrentRow.Cells[3].Value.ToString());
cmd = new OleDbCommand(sql, connect);
oku = cmd.ExecuteReader();
while (oku.Read())
{
txtOrj.Text = oku[0].ToString();
break;
}
}
catch
{
}//www.gorselprogramlama.com
connect.Close();
}
private void frmResult_Load(object sender, EventArgs e)
{
bilgiAl();
dgAll.Columns[0].Width = 65536;
for (int i = 1; i <= 3 ; i++)
{
dgAll.Columns[i].Visible = false;
}
}
private void btnDetails_Click(object sender, EventArgs e)
{
BaglantiKur();
int sure_No = Convert.ToInt32(dgAll.CurrentRow.Cells[1].Value);
DataTable dt = new DataTable();
string sql = "SELECT * FROM turkce WHERE sure_No=" + sure_No ;
OleDbDataAdapter adp = new OleDbDataAdapter(sql, connect);
adp.Fill(dt);
frmDetails frmD = new frmDetails();
frmD.dataGridView2.DataSource = dt;
dt = new DataTable();
sql = "SELECT * FROM arapca WHERE sure_No=" + sure_No ;
adp = new OleDbDataAdapter(sql,connect);
adp.Fill(dt);
frmD.dataGridView1.DataSource = dt;
//www.gorselprogramlama.com
dt = new DataTable();
sql = "SELECT * FROM orj_kuran WHERE sure_no = " + sure_No + " ORDER BY index";
adp = new OleDbDataAdapter(sql,connect);
adp.Fill(dt);
frmD.dataGridView3.DataSource = dt;
frmD.ShowDialog();
connect.Close();
}
private void btnCopy_Click(object sender, EventArgs e)
{
string metin = dgAll.CurrentRow.Cells[0].Value.ToString() + " / " + lblBilgi.Text;
Clipboard.SetText(metin);
}
private void dgAll_SelectionChanged(object sender, EventArgs e)
{
bilgiAl();
}
private void frmResult_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
dgAll.Size = new Size(934, 332);
groupBox1.Size = new Size(961, 533);
groupBox2.Size = new Size(949, 56);
groupBox3.Size = new Size(949, 360);//www.gorselprogramlama.com
groupBox4.Size = new Size(949, 84);
txtTercume.Size = new Size(811, 30);
txtOrj.Size = new Size(811, 30);
groupBox4.Location = new Point(6, 441);
btnTercume.Location = new Point(885, 16);
btnOrj.Location = new Point(885,51);
}
else if (this.WindowState == FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Maximized;
groupBox1.Width = (this.Width – 20);
groupBox1.Height = (this.Height – 40);
groupBox2.Width = groupBox1.Width – 10;
groupBox3.Width = groupBox1.Width – 10;
groupBox3.Height = groupBox1.Height – 178;
groupBox4.Width = groupBox1.Width – 10;
dgAll.Width = groupBox1.Width – 25;
dgAll.Height = groupBox1.Height – 205;
groupBox4.Location = new Point(6, groupBox3.Top + groupBox3.Height + 3);
txtTercume.Width = groupBox4.Width – 150;
btnTercume.Left = txtTercume.Width + 70;
txtOrj.Width = groupBox4.Width – 150;
btnOrj.Left = txtTercume.Width + 70;//www.gorselprogramlama.com
}
}
private void btnTercume_Click(object sender, EventArgs e)
{
Clipboard.SetText(txtTercume.Text + " / " + lblBilgi.Text);
}
private void btnOrj_Click(object sender, EventArgs e)
{
Clipboard.SetText(txtOrj.Text + " / " + lblBilgi.Text);
}//www.gorselprogramlama.com
}
}
[/code]
Ayetin yer aldığı sürenin tamamı
[code lang=”csharp”]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Kuran_ı_Kerim_Ayet_Bulucu
{
public partial class frmDetails : Form
{
public frmDetails()
{
InitializeComponent();
}//www.gorselprogramlama.com
private void frmDetails_Load(object sender, EventArgs e)
{
dataGridView1.Columns[0].Width = 65536;
dataGridView2.Columns[0].Width = 65536;
dataGridView3.Columns[0].Width = 65536;
for (int i = 1; i <=3; i++)
{
if (i != 2)
{
dataGridView1.Columns[i].Visible = false;
dataGridView2.Columns[i].Visible = false;
dataGridView3.Columns[i].Visible = false;
}
}
dataGridView1.Columns["ayet_No"].DisplayIndex = 0;
dataGridView2.Columns["ayet_No"].DisplayIndex = 0;
dataGridView3.Columns["ayet_No"].DisplayIndex = 0;
//www.gorselprogramlama.com
}
}
}
[/code]
Ümit Demirtaş






ya visual studio nun tüm programlarınız.tüm versiyonlaral uyumulu olsun
ömer öz :
bizdeki programlar 2008 ve 2010 ile yapılmıştır.
Gayet güzel olmuş. Elinize sağlık. Not: “Bizi beğenin” ekranı her sayfada açılmasa daha güzel olur.
veri tabanını açarken sifre istiyor
Çalışmıyor, arapça arama da yok.
Çok emek verilmiş sağolsun ama sorunlar var maalesef.
sonuncu :
programda sorun yok çalışıyor.
hey gidi yıllar hey 🙂 yıllar sonra bir konu hakkında arama yaparken kendi yazmış olduğum program a rastlamak 🙂