USER CONTROL DATALIST PROBLEM

S

Savas Ates

I have a simple Data list control in my user control. When I run my main
page and i use response.write to see grid query it writes 2 times. I checked
my query results it is true. My datalist doesnt show anything. What can be
the problem ?

<cc1:RDBCartList id="RDBCartList1" runat="server"
BottomDefaultTypeID="CARTHIS_BOTTOM1" BottomTypeID="CARTHIS_BOTTOM1"
EmptyDefaultTypeID="CARTHIS_EMPTY1" EmptyTypeID="CARTHIS_EMPTY1"
TopDefaultTypeID="CARTHIS_TOP1"
TopTypeID="CARTHIS_TOP1" TopFormatID="CARTHIS" InnerFormatID="CARTHIS"
EmptyFormatID="CARTHIS"
BottomFormatID="CARTHIS"></cc1:RDBCartList>
<asp:DataList id="DataList1" runat="server">
<ItemTemplate>
<table>
<tr>
<td>
<%# DataBinder.Eval(Container, "DataItem.CI_Billing_Email")%>
</td>
<td>
<%# DataBinder.Eval(Container, "Cart_ID")%>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>


CODEBEHIND
/////////////////////////////
cmd="SELECT * FROM Carts,PaymentInformations,CartInformations where
Carts.MainCompany='Market' and CartInformations.MainCompany='Market' and
PaymentInformations.MainCompany='Market' and
Carts.Cart_ID=PaymentInformations.PI_ID and
Carts.Cart_ID=CartInformations.CI_ID and Carts.Cart_AccountCompany='Market'
and Carts.Cart_AccountID='1' order by Carts.Cart_RegisterTime desc ";

baglantim=new SqlConnection ();


baglantim.ConnectionString =data.Connection.ConnectionString;

baglantim.Open ();


SqlCommand mycmd=new SqlCommand(cmd,baglantim);

Response.Write (cmd);

SqlDataAdapter da = new SqlDataAdapter ();

DataSet ds =new DataSet();




da.SelectCommand =mycmd;

da.Fill (ds,"MyTable");


DataList1.DataSource =ds;

DataList1.DataBind ();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top