473,378 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

REPEATER PROBLEM

It shows nothing . No error and nothing on the screen.There is no error too.
Im sure sql query is returns some rows i tried it Sql query analyser ? what
is the problem ?

<asp:Repeater id="Repeater1" runat="server">

<ItemTemplate>

<%# DataBinder.Eval(Container.DataItem,"urunadi")%>

</ItemTemplate>
</asp:Repeater>

private void Page_Load(object sender, System.EventArgs e)

{

string str=ConfigurationSettings.AppSettings["db_str"];

SqlConnection con = new SqlConnection ();

con.ConnectionString=str;

con.Open();
DataSet ds =new DataSet ();

SqlDataAdapter da =new SqlDataAdapter ("",con);

da.SelectCommand.CommandText =("SELECT TOP 3 * FROM TBL_PRODUCTS");

da.Fill (ds,"SAL");
Repeater1.DataSource =ds;

if (!Page.IsPostBack )

Repeater1.DataBind ();

}
Jun 29 '06 #1
2 1204
Hi,

First I suggest you to move ALL the code inside page_load to the if
(!IsPostBAck) section

next, put a breakpoint in the line Repeater1.DataSource =ds;

put in the watch window : ds.Tables[0].Rows.Count

just to be sure you have some rows

Are you sure that the "urunadi" column exist?

write this in the watch:

ds.Tables[0].Columns["urunadi"] if it does return null the column does not
exist.

--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Savas Ates" <in da club> wrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
It shows nothing . No error and nothing on the screen.There is no error
too. Im sure sql query is returns some rows i tried it Sql query analyser
? what is the problem ?

<asp:Repeater id="Repeater1" runat="server">

<ItemTemplate>

<%# DataBinder.Eval(Container.DataItem,"urunadi")%>

</ItemTemplate>
</asp:Repeater>

private void Page_Load(object sender, System.EventArgs e)

{

string str=ConfigurationSettings.AppSettings["db_str"];

SqlConnection con = new SqlConnection ();

con.ConnectionString=str;

con.Open();
DataSet ds =new DataSet ();

SqlDataAdapter da =new SqlDataAdapter ("",con);

da.SelectCommand.CommandText =("SELECT TOP 3 * FROM TBL_PRODUCTS");

da.Fill (ds,"SAL");
Repeater1.DataSource =ds;

if (!Page.IsPostBack )

Repeater1.DataBind ();

}

Jun 29 '06 #2
ok thank you.. i solved ..
Jun 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mark | last post by:
My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater to work just fine, as long as it's not...
2
by: Stephen Miller | last post by:
I am using the OnItemDataBound event of Repeater control to nest a DataGrid within the Repeater. When I attempt to bind to the DataGrid using the DataSource method I get the error message "Object...
2
by: Colin Nicholls | last post by:
Platform: ASP.NET 1.1 I have a repeater nested inside another repeater. My outer repeater is looping fine. I am manually binding the inner repeater to a DataReader obtained from another...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
3
by: Shimon Sim | last post by:
I put linkbutton in a repeater header. I attached event handler in makeup as onclick="btnSort_Click". Made btnSort_Click method public. It doesn't fire if I click on it. I tried to attach it in...
2
by: mark | last post by:
(not sure if this is the correct group) My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater...
0
by: uncensored | last post by:
Hello everyone, I'm fairly new at .Net and I have a repeater inside a repeater problem. I will attach my code to this message but basically what I am able to tell when I run my page it tells me...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
1
by: jazzart | last post by:
Hi there, I'm fairly new to programming with Asp.Net 2.0 so I'm finding myself regularly fumbling around in the dark a bit, so to speak. I'm currently using Visual Web Developer and have been...
2
by: Hong | last post by:
Hi, I have been scratching my head over this problem for hours, the repeater control I am using would only render the controls specified in HeaderTemplate and FooterTemplate, but the repeater...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.