05-01-23, 10:09 PM
كود :
If con.State = ConnectionState.Closed Then con.Open()
Dim strsql As String
strsql = "select id,month1,month2,month3,month4,month5,month6,month7,month8,month9,month10,month11,month12 from TBLDAAT where id='" + TextBox7.Text + "'"
Dim cmd2 As New OleDbCommand(strsql, con)
Dim myreader As OleDbDataReader
myreader = cmd2.ExecuteReader
myreader.Read()
ListBox1.Items.Clear()
ListBox1.Items.Add(myreader("month1"))
ListBox1.Items.Add(myreader("month2"))
ListBox1.Items.Add(myreader("month3"))
ListBox1.Items.Add(myreader("month4"))
ListBox1.Items.Add(myreader("month5"))
ListBox1.Items.Add(myreader("month6"))
ListBox1.Items.Add(myreader("month7"))
ListBox1.Items.Add(myreader("month8"))
ListBox1.Items.Add(myreader("month9"))
ListBox1.Items.Add(myreader("month10"))
ListBox1.Items.Add(myreader("month11"))
ListBox1.Items.Add(myreader("month12"))
con.Close()
