USER CONTROL DATALIST PROBLEM

Discussion in 'ASP .Net Datagrid Control' started by Savas Ates, Sep 7, 2006.

  1. Savas Ates

    Savas Ates Guest

    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 ();
     
    Savas Ates, Sep 7, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,966
  2. Replies:
    0
    Views:
    1,485
  3. Mad Scientist Jr
    Replies:
    0
    Views:
    679
    Mad Scientist Jr
    Mar 22, 2006
  4. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    583
    Jonathan Wood
    Feb 2, 2010
  5. Will

    Problem with DataList within DataList

    Will, Oct 10, 2007, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    200
    Walter Wang [MSFT]
    Oct 18, 2007
Loading...

Share This Page