<%@ Page Language="VB" %>
<%@ import Namespace="eInfoDesigns.dbProvider.mySqlClient" %>
<script runat="server">
    sub page_load()
        dim conn as mysqlconnection
        dim cmd as mysqlcommand
        try
            conn = new mysqlconnection("Data Source=localhost;Database=someDb;User ID=sa;Password=sa")
            conn.open()
            cmd = new mysqlcommand("SELECT * FROM someTable", conn)
            theGrid.datasource = cmd.executeReader()
            theGrid.databind()
        catch ex as mysqlexception
            lblText.text = ex.toString()
        finally
            if conn.state = 8 then 'stänger kopplingen till databasen till sist
                conn.close()
            end if
        end try
    end sub
</script>