filmov
tv
Vb 2008 express linked to an online database
Показать описание
Visual basic 2008 downloaded here.
This download is from my sql and its a connector for vb.
This download is from my sql and is gui tools for vb.
This is the website where the database will be created.
Imports System.Data.SqlClient
Imports MySql.Data.MySqlClient
Public Class Form1
Dim mySqlConnection As MySqlConnection
Dim myadapter As New MySqlDataAdapter
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MySqlConnection = New MySqlConnection
MySqlConnection.Open()
Dim myData As MySqlDataReader
Dim sqlquary = " SELECT * From dataonline where location = 'westport'"
Dim command As New MySqlCommand
command.Connection = mySqlConnection
command.CommandText = sqlquary
myData = command.ExecuteReader
myData.Read()
Label2.Text = myData.GetValue(0)
Label4.Text = myData.GetValue(1)
Dim myadapter As New MySqlDataAdapter
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
mySqlConnection = New MySqlConnection
mySqlConnection.Open()
Dim myData As MySqlDataReader
Dim sqlquary = " INSERT INTO dataonline (name, age, sex, location, phonenum) VALUES ('mary',254, 'female', 'dysart', 13456)"
Dim command As New MySqlCommand
command.Connection = mySqlConnection
command.CommandText = sqlquary
myData = command.ExecuteReader
End Sub
End Class
Комментарии