Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class _Default
- Inherits System.Web.UI.Page
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- End Sub
- Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim ds As DataSet = New DataSet
- Dim connection As New SQLite.SQLiteConnection("Data Source=7-11_TawaDB")
- Dim adapter As New SQLite.SQLiteDataAdapter("SELECT * FROM exam_branch", connection)
- connection.Open()
- adapter.Fill(ds, "exam_branch")
- For i As Integer = 0 To adapter.Fill(ds) - 1
- 'adapter.Fill(ds) => จำนวนข้อมูลที่มี เช่นตัวอย่างที่อยู่ในฐานข้อมูล มีสาขา 7-11 อยู่ 34 สาขา สรุปก็คืออันนี้วนลูปตั้งแต่ 0 ถึง 34 - 1
- TextBox1.Text += ds.Tables("exam_branch").Rows(i).Item("name_branch") + Environment.NewLine
- Next
- connection.Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment