Jump to content

Wpf App. Combobox'a Dataset'ten Veri Getirme?


hardboymlh
 Share

Recommended Posts

Proje ödevim için bir çalışma yapmaktayım.
Visual Studio 2010'da C# dilinde WPF Application üzerinde çalışıyorum. MainWindow'da 1 combobox 1 textbox 1 buton var
MS Access 2007de oluşturduğum vtdan bilgileri DataSet nesnesine aktarıyorum ancak DataSetten ComboBoxa yükleyemiyorum.
vt ismi= Notdefteri.accdb
tablo adı= notlar
tablo alanları: ad,soyad,sinif,sube,sinav1,sinav2
notlar tablosundaki sinif bilgisini comboya yüklemek için neler yapmalıyım?



Window_Loaded kodu:

[code]OleDbConnection bag = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= Notdefteri.accdb");
bag.Open();
string sorgu = "Select distinct sinif from notlar";
OleDbCommand kmt = new OleDbCommand(sorgu, bag);

OleDbDataAdapter adt = new OleDbDataAdapter(kmt);
DataSet ds = new DataSet();
adt.Fill(ds, "sinif");
bag.Close();[/code]


soru1:comboboxa verileri ekleyebilmek için bag.close(); satırından önce hangi kodları eklemem gerekli?
soru2: verileri comboya yükledikten sonra seçilen değeri textbox'ın text özelliğine atabilmek için buton1in click'ine hangi kodları yazmalıyım?

acil cevaplarınızı bekliyorum Edited by hardboymlh
Link to comment
Share on other sites

  • Moderator

[warning] [b][color="#000000"]DİKKAT: [/color][color="#FF0000"]Konu başlığını forum kurallarına göre [img]http://i.imgur.com/pX2CV.png[/img] butonunu kullanarak yeniden düzenleyiniz. Aksi halde çöpe taşınacaktır.[/color]

[topic=872]Forum Kuralları[/topic] - [ Madde 10-16 ]

[color="#0000FF"]Konu düzenlenene kadar yazılan tüm iletiler silinecektir ![/color] [/b] [/warning]

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...