Hi all,
I am using DataList and when i run my project the table of the datalist doesn't appear?!!!
aspx.vb file
Imports System.Data.SqlClient
Public Class SLP_1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' TextBox1.Text = Session(logAccount)
End Sub
Protected Sub DataList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataList1.SelectedIndexChanged
Dim con As SqlConnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\sony\Documents\Visual Studio 2010\Projects\SADA\SADA\App_Data\SADA2.mdf';Integrated Security=True;User Instance=True")
Dim cmdStr As String = "SELECT PateintTbl.PateintId, PateintTbl.P_f_Name, PateintTbl.P_L_Name, PateintTbl.SLP_ID FROM PateintTbl INNER JOIN SLP ON PateintTbl.SLP_ID = Session(logAccount)"
Dim da As SqlDataAdapter = New SqlDataAdapter(cmdStr, con)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "imp")
DataList1.DataSource() = ds
DataList1.DataBind()
End Sub
End Class
aspx file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DataList ID="DataList1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataSourceID="SqlDataSource1" GridLines="Both">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<ItemStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text="test"></asp:Label>
<br />
<br />
</div>
</form>
</body>
</html>
Any idea?!!! plz help!!!!
Thanks in advance..