CLASS CONNECTION
Imports MySql.Data.MySqlClient
Public class connection
Protected cnn as new MySqlConnection
Public username as a whole
Protected function connected ()
Try
cnn = New MySqlConnection ("Server = localhost; Uid = root; Database = operator")
cnn.Open ()
Back true
Catch ex as an exception
MsgBox (ex.Message)
False return
Final test
Final function
Protected function disconnected ()
Try
If cnn.State = ConnectionState.Open Then
cnn.close ()
Back true
Plus
False return
It will end if
Catch ex as an exception
MsgBox (ex.Message)
False return
Final test
Final function
Final class
FCLIENTE CLASS
Public class of fcliente
Inherit connection
Dim cmd As New MySqlCommand
Public function show () as data table
Try
connected ()
cmd = New MySqlCommand ("show_client")
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = cnn
If cmd.ExecuteNonQuery Then
Dim dt As New DataTable
Dim da As New MySqlDataAdapter (cmd)
da.Fill (dt)
Back dt
Plus
Return nothing
It will end if
Catch ex as an exception
MsgBox (ex.Message)
Return nothing
Finally
disconnected ()
Final test
Final function
Final class
my stored procedure is show_client
CREATE PROCEDURE to show_client ()
START
SELECT * FROM CUSTOMER ORDER BY customer.client customer desc;
FINISH
if I do it that way I get an error in the mysql
now if I think so
CREATE PROCEDURE to show_client ()
SELECT * FROM CUSTOMER ORDER BY customer.client customer desc;
I do not get an error but nothing happens in the form
but if I make a select only for example
SELECT * FROM THE CUSTOMER ORDER BY customer.client customer
there if you upload the data to the form
I would like to know why there is no charge.