sodra 0 Denunciar post Postado Janeiro 13, 2004 Olá pessoal, criei um código só que está dando erro de sintaxe nesta linha: Imports System.Data.OleDb O código inteir é este aqui: <%@ Page Language="VB" %><script runat="server"> ' Insert page code here ' Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Imports System.Data.OleDb Dim sql As String = "SELECT nome, sobrenome FROM classificados ORDER BY nome" Dim conn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDataReader conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data Source=c:\inetpub\wwwroot\classificados\classificados.mdb") conn.Open() Try cmd = New OleDbCommand(sql, conn) dr = cmd.executeReader() TextBox1 = "" Try Do While dr.Read() TextBox1.Text += dr("nome") & " (" & dr("sobrenome") & ")" & VBCrlf 'Response.Write (dr("nome") & " (" & dr("sobrenome") & ")<br>") Loop Finally dr.Close() end Try Finally conn.Close() dr = Nothing conn = Nothing End Try End Sub</script><html><head></head><body> <form runat="server"> <p align="center"> <asp:Label id="Label1" runat="server" forecolor="Red" font-size="Large" font-bold="True">ASP.NET - SELECT</asp:Label> </p> <p> <asp:TextBox id="TextBox1" runat="server" TextMode="MultiLine" Width="582px" Height="470px" OnTextChanged="TextBox1_TextChanged"></asp:TextBox> </p> <!-- Insert content here --> </form></body></html> Compartilhar este post Link para o post Compartilhar em outros sites
wozniak 0 Denunciar post Postado Janeiro 13, 2004 prontinho p/ usar <%@ Page Language="VB" %><%@ import Namespace="System.Data" %><%@ import Namespace="System.Data.Oledb" %><script runat="server"> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sql As String = "SELECT usuario, email FROM tbl_admin ORDER BY usuario" Dim conn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OledbDataReader conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data Source=C:\cris_taylor\bd\cris.mdb") conn.Open() Try cmd = New OleDbCommand(sql, conn) dr = cmd.executeReader() Try Do While dr.Read() TextBox.Text += dr("usuario") & " (" & dr("email") & ")" & VBCrlf 'Response.Write (dr("nome") & " (" & dr("sobrenome") & ")<br>") Loop Finally dr.Close() end Try Finally conn.Close() dr = Nothing conn = Nothing End Try End Sub</script><html><head></head><body> <form runat="server"> <p align="center"> <asp:Label id="Label1" runat="server" forecolor="Red" font-size="Large" font-bold="True">ASP.NET - SELECT</asp:Label> </p> <p> <asp:TextBox id="TextBox" runat="server" TextMode="MultiLine" Width="582px" Height="470px" ></asp:TextBox> </p> <!-- Insert content here --> </form></body></html> qualquer coisa é só postar t+ Compartilhar este post Link para o post Compartilhar em outros sites