คือพอดีทำโปรเจคครับ แล้วจำเป็นต้องใช้ array 2 มิติ ซึ่ง จะ เอาข้อมูลจากฐานข้อมูล มาไว้ใน (a,1) ครับแต่ว่าหาอ่านในเน็ตแล้วก็ไม่เจอที่ตรงกัน
รบกวนผู้ที่รู้ช่วยหน่อยครับ
ปล.ใช้ VB 2010 กับ access 2007 ครับ
Codeครับ
Dim dr As OleDbDataReader
Dim code As String = TextBox1.Text
Dim s As String = "select * from DB_Rent where m_id='" & code & "' "
Dim b As Integer
Dim btm() As Button = {Button1, Button2, Button3, Button4, Button5, Button6}
dr = Executereader(s)
dr.Read()
For a = 0 To 100
K(a, 1) = dr.Item("ID_book").ToString
Next
ผมว่าน่าจะมีปัญหาตรงนี้อะครับเพราะว่า (b,2) จะเป็นเลขเดียวกันตลอดครับ
For b = 0 To 100
K(b, 2) = dr.Item("status").ToString
Next
TextBox1.Text = K(3, 1)
For d = 0 To 5 Step 1
If K(d, 2) = "1" Then
btm(d).Text = K(d, 1) & vbNewLine
End If
Next
ขอบคุณมากๆครับ
ขอความช่วยเหลือครับ เรื่อง import ข้อมูลจาก access เข้ามาใน vb ที่เป็น array ครับ
รบกวนผู้ที่รู้ช่วยหน่อยครับ
ปล.ใช้ VB 2010 กับ access 2007 ครับ
Codeครับ
Dim dr As OleDbDataReader
Dim code As String = TextBox1.Text
Dim s As String = "select * from DB_Rent where m_id='" & code & "' "
Dim b As Integer
Dim btm() As Button = {Button1, Button2, Button3, Button4, Button5, Button6}
dr = Executereader(s)
dr.Read()
For a = 0 To 100
K(a, 1) = dr.Item("ID_book").ToString
Next
ผมว่าน่าจะมีปัญหาตรงนี้อะครับเพราะว่า (b,2) จะเป็นเลขเดียวกันตลอดครับ
For b = 0 To 100
K(b, 2) = dr.Item("status").ToString
Next
TextBox1.Text = K(3, 1)
For d = 0 To 5 Step 1
If K(d, 2) = "1" Then
btm(d).Text = K(d, 1) & vbNewLine
End If
Next
ขอบคุณมากๆครับ