tello_14_bjk Posted March 9, 2014 Share Posted March 9, 2014 S.a arkadaşlar c# da bir projem var ve checkedlistbox'a veritabanından veri çekmek istiyorum nasıl yapabilirim nette baya araştırdım ama bulamadım malesef bana ayrıntılı olarak anlatabilecek olan arkadaşlarımız var mı şimdiden çok teşekkürler. . Quote Link to comment Share on other sites More sharing options...
akkayaonur Posted March 9, 2014 Share Posted March 9, 2014 Aslında veriyi nasıl çağıracağın veritabanını projeye nasıl bağladığına göre değişir. Eğer entityframework ile katmanlı yapı oluşturduysan linq sorguları ile veriyi doğrudan checked listbox nesnesine ekletebilirsin. Ya da bir connection nesnesi yapıp t-sql sorguları ile veri getirip bu veriyi bir döngü kullanarak chekedlistbox a ekletebilirsin. Ya da visual studio arayüzünü kullanarak bir veri tabanı bağlayıp property kısmındaki datasource alanında doğrudan veri kaynağı olarak gösterebilirsin. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 9, 2014 Editor Share Posted March 9, 2014 Bu konu "Webmaster İstek" forumundan "Yazılım" forumuna taşınmıştır. Quote Link to comment Share on other sites More sharing options...
tello_14_bjk Posted March 9, 2014 Author Share Posted March 9, 2014 datasourceden olmuyor .s kod örneği yok mu visual stadio için .s Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 10, 2014 Editor Share Posted March 10, 2014 checkedListBox1.Items.Add("a"); Bu şekilde item ekleye bilirsiniz. Quote Link to comment Share on other sites More sharing options...
tello_14_bjk Posted March 10, 2014 Author Share Posted March 10, 2014 checkedListBox1.Items.Add("a"); Bu şekilde item ekleye bilirsiniz. Dostum bunu bende biliyorum ama ben kendim eklemek istemiyorum veritabanında bilgileri checkedlisbox a çekmek istiyorum sadece bu yok mu bu sorunun bi çözümü ya dünden beri bunla uğraşıyorum :( :( Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 10, 2014 Editor Share Posted March 10, 2014 [spoiler] [/spoiler] Kod istiyorum dedin sonrada biliyorum bunu diyorsun neyi kast ettiğini anlamadım sanırım istediğin bu. Quote Link to comment Share on other sites More sharing options...
tello_14_bjk Posted March 10, 2014 Author Share Posted March 10, 2014 [spoiler] [/spoiler] Kod istiyorum dedin sonrada biliyorum bunu diyorsun neyi kast ettiğini anlamadım sanırım istediğin bu. Yok diğer arkadaş datasource den yapabilirsin dedi de ondan kod ile olanı yok mu diye dedim ben kb kardeşim ama bu senin dediğin de olmadı ya .s Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 10, 2014 Editor Share Posted March 10, 2014 (edited) Arkadaşın dediği datasource kısmı bu işte.Ne istediğini anlayamadım malesef. Edited March 10, 2014 by pairs Quote Link to comment Share on other sites More sharing options...
tello_14_bjk Posted March 10, 2014 Author Share Posted March 10, 2014 Arkadaşın dediği datasource kısmı bu işte.Ne istediğini anlayamadım malesef. dostum ben de diyorum ki onu zaten yaptım :) ama olmuyor ordan malesef checkedlistbox'a aktarmıyor ama şimdi sonunda sorunumu çözdüm çok şükür vaktinizi ayırdığınız için ;) Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 10, 2014 Editor Share Posted March 10, 2014 Nasıl çözüdüğünü paylaşırsan başkasıda faydalansın. Quote Link to comment Share on other sites More sharing options...
tello_14_bjk Posted March 10, 2014 Author Share Posted March 10, 2014 SqlConnection baglanti = new SqlConnection(@"Data Source=KocaReis\ALISAYLICASQL;Initial Catalog=market;Integrated Security=True"); SqlCommand sqlKomut = new SqlCommand(); DataTable dtTablo = new DataTable(); SqlDataAdapter adtr = new SqlDataAdapter(); private void Form2_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'marketDataSet18.Urun_Saticilari' table. You can move, or remove it, as needed. //this.urun_SaticilariTableAdapter.Fill(this.marketDataSet18.Urun_Saticilari); baglanti.Open(); sqlKomut.CommandText = @"select * from urun_saticilari"; sqlKomut.Connection = baglanti; adtr.SelectCommand = sqlKomut; adtr.Fill(dtTablo); //dataGridView_ornek.DataSource = dtTablo; sqlKomut.CommandText = @"select * from Urun_Hiyerarsi"; sqlKomut.Connection = baglanti; adtr.SelectCommand = sqlKomut; dtTablo = new DataTable(); adtr.Fill(dtTablo); for (int x = 0; x < dtTablo.Rows.Count; x++) { checkedListBox1.Items.Add(dtTablo.Rows[x][2].ToString() + ">>" + dtTablo.Rows[x][3].ToString()); } baglanti.Close(); Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 10, 2014 Editor Share Posted March 10, 2014 BEnim veya diğer arkadaşın dediğinden ne farkı var kodlarının. Quote Link to comment Share on other sites More sharing options...
tello_14_bjk Posted March 12, 2014 Author Share Posted March 12, 2014 (edited) Arkadaşlar bir sorum daha olacak ne yaptımsa olmadı .s benim şimdi bir textbox'ım var ve ben orda ki yazılan ismi sql veritabanına aktarmak istiyorum :( nasıl yapabilirim ? veritabanımın adı market tablomun adı Urun_Saticilari eklemek istediğim sütun ise Satici_İsmi yardımcı olabilecek arkadaşımız var mı acaba .s Edited March 12, 2014 by tello_14_bjk 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.