Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
Програма за правене на програмиembaka каза:Това програма ли е или е сайт, кое от двете последно
Imports MySql.Data.MySqlClient
Public Class Form1
Public connection As New MySqlConnection("SERVER=server;DATABASE=database;UID=user;PWD=pass;PORT=3306")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
connection.Open()
Dim query As New MySqlCommand("SELECT * FROM `tablicata`")
Dim reader As MySqlDataReader
reader = query.ExecuteReader()
While reader.Read()
reader.Item("ime_na_poleto")
End While
reader.Close()
connection.Close()
End Sub
End Class
WarezBg каза:Успях да го изкарам, но проблем е друго.. вади само по 1 резултат от таблицата.. как да направя да ги вади всичките?
WarezBg каза:Успях да го изкарам, но проблем е друго.. вади само по 1 резултат от таблицата.. как да направя да ги вади всичките?
Error 1 Property access must assign to the property or use its value.
Ето така съм го изкарал...StormBreaker каза:WarezBg каза:Успях да го изкарам, но проблем е друго.. вади само по 1 резултат от таблицата.. как да направя да ги вади всичките?
Така както си го направил вади всичките. Въпроса е къде ги визуализираш.
WarezBg каза:Ето така съм го изкарал...StormBreaker каза:WarezBg каза:Успях да го изкарам, но проблем е друго.. вади само по 1 резултат от таблицата.. как да направя да ги вади всичките?
Така както си го направил вади всичките. Въпроса е къде ги визуализираш.
Това се съдържа в таблицата ми ->
![]()
Imports MySql.Data.MySqlClient
Public Class Form1
Public connection As New MySqlConnection("SERVER=localhost;DATABASE=test;UID=root;PWD=;PORT=3306")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
connection.Open()
LoadMp3()
End Sub
Private Sub LoadMp3()
Dim command As New MySqlCommand("SELECT * FROM `tablica`", connection)
Dim reader As MySqlDataReader
reader = command.ExecuteReader()
While reader.Read
TextBox1.Text = reader.Item("name") & " - " & reader.Item("filename")
End While
reader.Close()
connection.Close()
End Sub
End Class
Imports MySql.Data.MySqlClient
Public Class Form1
Public connection As New MySqlConnection("SERVER=localhost;DATABASE=test;UID=root;PWD=;PORT=3306")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
connection.Open()
LoadMp3()
End Sub
Private Sub LoadMp3()
Dim command As New MySqlCommand("SELECT * FROM `tablica`", connection)
Dim reader As MySqlDataReader
reader = command.ExecuteReader()
TextBox1.Text = ""
While reader.Read
TextBox1.Text &= reader.Item("name") & " - " & reader.Item("filename") & ControlChars.NewLine
End While
reader.Close()
connection.Close()
End Sub
End Class
Imports MySql.Data.MySqlClient
Public Class Form1
Public connection As New MySqlConnection("SERVER=localhost;DATABASE=test;UID=root;PWD=;PORT=3306")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
connection.Open()
LoadMp3()
End Sub
Private Sub LoadMp3()
Dim command As New MySqlCommand("SELECT * FROM `tablica`", connection)
Dim reader As MySqlDataReader
reader = command.ExecuteReader()
ListBox1.Items.Clear()
While reader.Read
ListBox1.Items.Add(reader.Item("name"))
End While
reader.Close()
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim command As New MySqlCommand("SELECT * FROM `tablica` WHERE `name` = '" + ListBox1.SelectedItem.ToString + "'", connection)
Dim reader As MySqlDataReader
reader = command.ExecuteReader()
reader.Read()
Label1.Text = reader.Item("name")
reader.Close()
connection.Close()
End Sub
End Class
WarezBg каза:Аз се оправих, трябвало е да махна connection.Close()![]()