You are on page 1of 2

Dim strNome as string

Dim intCode as Integer
Dim strSenha as string
Dim MyConn as OLEDBConnection
Dim objDR as OLEDBDatareader
Dim Cmd as OLEDBCommand
Dim opcao as Integer
Dim bprimeirologin as Boolean
Sub dologin(Source as Object, E as EventArgs)
Dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:/inetpub/
wwwroot/dados/BolaoF1.mdb"
Dim MySQL as string = "Select CodigoParticipante , NomeParticipante , Chave , Se
nha , primeirologin from Participantes Where Chave = '" & lguid.text & "' and Se
nha = '" & CripSenha(lgPWD.text) & "'"
Dim MyConn as New OleDbConnection(strConn)
Dim Cmd as New OleDbCommand(MySQL, MyConn)
MyConn.Open()
objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
if Not objDR.Read() then
label1.text = "<h1><b>Chave / Senha Inválidas !</b></h1></p>"
objDR.Close
Myconn.Close
else
objDR.close
Myconn.Open
While objDR.Read()
strNome=objDR("NomeParticipante")
intCode=objDR("CodigoParticipante")
bprimeirologin=objDR("primeirologin")
End While

'INSERT
SQL Server
<%@ Import Namespace="System.Data" %>
<%@ Import NameSpace="System.Data.SqlClient" %>
<%
Dim conexao As SqlConnection
Dim comando As SqlCommand
conexao = New SqlConnection("server=localhost;uid=sa;pwd=senha;database=TesteDB"
)
conexao.Open()
comando = New SqlCommand( "Insert Teste ( coluna ) Values ( 'Teste' )", conexao
)
comando.ExecuteNonQuery()
conexao.Close()
%>

SQL Server Access

Open() %> conexao access <%@ Import Namespace="System.Data" %> <%@ Import NameSpace="System.0.OleDb" %> <% Dim conexao As OleDbConnection conexao = New OleDbConnection( "PROVIDER=Microsoft.DATASource=c:\ teste.uid=sa" ) conexao.Data.OLEDB.SqlClient" %> <% Dim conexao As SqlConnection conexao = New SqlConnection( "server=localhost.Jet.Data.database=Pubs.mdb" ) conexao.Data" %> <%@ Import NameSpace="System. <%@ Import Namespace="System.4.Open() %> .