fatih29 Posted June 12, 2020 Share Posted June 12, 2020 (edited) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.OleDb; namespace İlaç_Bul { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public OleDbConnection con; public OleDbDataReader dr; public OleDbCommand cmd; private void button1_Click(object sender, EventArgs e) { if(textBox1.Text == string.Empty) { MessageBox.Show("İlaç Adı Giriniz"); } else { listView1.Items.Clear(); con = new OleDbConnection("Provider=Microsoft.ACE.Oledb.12.0;Data Source=ilac.accdb"); coa.Open();c cmd = new OleDbCommand("Selact* From veriler", con); dr = cmd.ExecuteReader(); while (dr.Read()) { ListViewItem item = new ListViewItem(dr["id"].ToString()); item.SubItems.Add(dr["ilac-adi"].ToString()); item.SubItems.Add(dr["il"].ToString()); item.SubItems.Add(dr["eczaneler"].ToString()); listView1.Items.Add(item); } coan.Close(); } } } } ========================================================== con.Open hatası alıyorum veriyi çekemiyorum yardım edebilirmisiniz tşk. Proje Yönetimi.rar Edited June 12, 2020 by fatih29 Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted June 12, 2020 Share Posted June 12, 2020 Build kısmından x64 yapınca sorun çözüldü. Please register to see this content. Quote Link to comment Share on other sites More sharing options...
fatih29 Posted June 13, 2020 Author Share Posted June 13, 2020 Build derken ve ayrıca tek ilaç ismi gelmesi için ne yapmalılıym tşk Quote Link to comment Share on other sites More sharing options...
fatih29 Posted June 14, 2020 Author Share Posted June 14, 2020 visual studio 2019 türkçe kullanıyorum ismi başka olabilirmi tşk Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted June 16, 2020 Share Posted June 16, 2020 Build, projenin belirtilen seçenekler doğrultusunda derlenmesi demektir. Sadece yazılan ilacın isminin gelmesi için; if (dr["ilac-adi"].ToString() == textBox1.Text) { ListViewItem item = new ListViewItem(dr["id"].ToString()); item.SubItems.Add(dr["ilac-adi"].ToString()); item.SubItems.Add(dr["il"].ToString()); item.SubItems.Add(dr["eczaneler"].ToString()); listView1.Items.Add(item); } Quote Link to comment Share on other sites More sharing options...
fatih29 Posted June 17, 2020 Author Share Posted June 17, 2020 (edited) if (dr["ilac-adi"].ToString() == textBox1.Text) ///====> Bu kod AB==AB şeklinde peki Ab==AB nasıl yapabiliriz { ListViewItem item = new ListViewItem(dr["id"].ToString()); item.SubItems.Add(dr["ilac-adi"].ToString()); item.SubItems.Add(dr["il"].ToString()); item.SubItems.Add(dr["eczaneler"].ToString()); listView1.Items.Add(item); yani ListViewItem de olan "ababab" şeklindeki yazıyı biz "ABABAB " DİYE ÇAGIRA BİLİRMİYİZ TŞK.. EMEGİN İÇİN Edited June 24, 2020 by fatih29 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.