Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27443

VS 2010 How to use my function?

$
0
0
Hello,

I created a class with some database functions for MySQL and I used a PHP class and I rewritten that to VB.NET. Now I like to know how I could get information from the database and use that information. Here is my class:
Code:

    Public Sub Query(ByVal sql)
        Try
            Dim conn = Connect()
            Dim myCommand As New MySqlCommand

            myCommand.CommandText = sql
            myCommand.Connection = conn

            myCommand.ExecuteNonQuery()
        Catch myerror As MySqlException
            logMessage("Error: " & myerror.Message)
            Exit Sub
        End Try
    End Sub

I don't know how to extract information from a query line and I like to know how to do that. My database table is:

UserID | UserName | UserPass | UserRole

Could somebody help me?

Viewing all articles
Browse latest Browse all 27443

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>