Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/07/2005, 17:19
pepelucho
 
Fecha de Ingreso: enero-2002
Ubicación: Callao - Perú
Mensajes: 1.127
Antigüedad: 22 años, 4 meses
Puntos: 0
Exclamación Error en datalist(no muestra datos)

Hola a todos, tengo un error en el datalist, ejecuto mi sql en el datalist pero no me aparece ningun dato me manda la pagina en blanco a que se debe?
Ojo que mi SQL si funciona ya lo probe en el query analyzer
Código PHP:
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ 
Import Namespace="System.Data" %>
<%@ 
Page Language="vb" AutoEventWireup="false" Codebehind="facturas_cliente.aspx.vb" Inherits="Facturas.facturas_cliente"%>
<
HTML>
<
HEAD>
<
title>facturas_cliente</title>
<
meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<
meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<
meta name="vs_defaultClientScript" content="JavaScript">
<
meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<
script language="VB" runat="server">
 
Sub Page_Load(sender As ObjectAs EventArgs
dim cn as new sqlconnection
Dim dap 
As SqlDataAdapter     
cn
= New SqlConnection("server=localhost;" 
            
"database=dbdata;Trusted_Connection=Yes")
     
' Connect to the SQL database using a SQL SELECT query to get all 
     ' 
the data from the "Titles" table.
     
dap= New SqlDataAdapter("SELECT * FROM facturas where cliente=64"cn)
     
' Create and fill a DataSet.
     Dim ds As DataSet = new DataSet()
     dap.Fill(ds)
     ' 
Bind MyDataList to the DataSetMyDataList is the ID for 
      
the DataList control in the HTML section of the page.
     
MyDataList.DataSource ds
     MyDataList
.DataBind()
End Sub
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<%-- Open the DataList control and set it for two columns, to be 
     filled in horizontal order. --%>
<ASP:DataList id="MyDataList" RepeatColumns="1" RepeatDirection="Horizontal" runat="server" ShowHeader="False"
    ShowFooter="False">
    <ItemTemplate>
     <DIV style="PADDING-RIGHT: 15px; PADDING-LEFT: 15px; FONT-SIZE: 10pt; PADDING-BOTTOM: 15px; PADDING-TOP: 15px; FONT-FAMILY: Verdana">
     <DIV style="FONT: 12pt verdana; COLOR: darkred"><I><%# DataBinder.Eval(Container.DataItem, "id")%></I></B></DIV>
     <BR>
     <B>Title ID: </B>
     <%# DataBinder.Eval(Container.DataItem, "nro_factura") %>
     <BR>
     <B>Category: </B>
     <%# DataBinder.Eval(Container.DataItem, "cliente")%>
     <BR>
     <B>Publisher ID: </B>
     <%# DataBinder.Eval(Container.DataItem, "estado") %>
     <BR>
     </DIV>
    </ItemTemplate>
</ASP:DataList>
</form>
</body>
</HTML> 
__________________
SaLuDoS dE:
PePeLuChO dEl PeRú PaRa El MuNdO

Última edición por pepelucho; 05/07/2005 a las 17:20 Razón: mejor explicacion de pregunta