Getting data from MS Access database and display it in a listbox

后端 未结 7 809
伪装坚强ぢ
伪装坚强ぢ 2020-12-11 06:37

How do I read data in ms access database and display it in a listbox. I have the codes here but i got errors.

 private void button3_Click(object sender, Even         


        
7条回答
  •  时光取名叫无心
    2020-12-11 07:12

    change

    listBox1.Text = Reader.GetString("FirstName");
    

    to

    listBox1.Text = Reader.GetString(0); // zero base ordinal of column
    

提交回复
热议问题