469,950 Members | 2,480 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

USER CONTROL DATALIST PROBLEM

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 ();


Sep 7 '06 #1
0 820

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Mary Kerrigan | last post: by
4 posts views Thread by Yan Wang | last post: by
6 posts views Thread by Davids | last post: by
reply views Thread by Rick Wez | last post: by
1 post views Thread by yoknows | last post: by
2 posts views Thread by Amil Hanish | last post: by
1 post views Thread by Salim | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.