[Mono-bugs] [Bug 48217][Wis] New - DataList data binding bug

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 8 Sep 2003 06:44:33 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by yaronsh@mainsoft.com.

http://bugzilla.ximian.com/show_bug.cgi?id=48217

--- shadow/48217	2003-09-08 06:44:33.000000000 -0400
+++ shadow/48217.tmp.23797	2003-09-08 06:44:33.000000000 -0400
@@ -0,0 +1,99 @@
+Bug#: 48217
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: yaronsh@mainsoft.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataList data binding bug
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+
+Description of Problem:
+Data Bind of data to a data list "skips" the last row that should be 
+binded.
+
+Steps to reproduce the problem:
+1. Create a table named "Reviews" with the columns "Comments"   
+   and "CustomerName" in SQL server (and fill 3 rows in it).
+2. Modify line 10 in the attached aspx file (in the attached test case) to 
+   the server that you work with (Direct the SQL connection to your server)
+3. Run the testcase
+4. Click the button "Fill"
+
+Actual Results:
+There is unreasonable gap between the first and the second items
+in the DataList.
+The third row doesn't appear at all.  
+
+Expected Results:
+All rows should appear with equal gaps between them.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+
+<%@ Import Namespace="System.Data.SqlClient" %>
+
+<HTML>
+     <HEAD>
+	<script language=C# runat=server>
+	private void BtnFill_Click(object sender, System.EventArgs e)
+	{
+	    SqlConnection connection = new SqlConnection
+		("server=rafim-2k;User Id=sa;Password=;database=store");
+
+	    try 
+	    {
+		connection.Open (); 
+		SqlCommand command = new SqlCommand
+			("select * from Reviews", connection);
+
+		SqlDataReader reader = command.ExecuteReader ();
+				
+		//Connect and Bind
+		MyList.DataSource = reader;
+		MyList.DataBind ();
+	    }
+	    finally 
+	    {
+		connection.Close ();
+	    }
+	}
+     </script>
+     </HEAD>
+     <body MS_POSITIONING="GridLayout">
+	<form id="Form1" method="post" runat="server">
+	     <asp:DataList ID="MyList" runat="server" width="500" 
+                  cellpadding="0" cellspacing="0">
+		  <ItemTemplate>
+		       <asp:Label Text='<%# DataBinder.Eval
+                          (Container.DataItem, "CustomerName") %>' 
+                           runat="server" ID="Label1"/>
+			   <br>
+			<asp:Label class="Normal" Text='<%# DataBinder.Eval
+                            (Container.DataItem, "Comments") %>' 
+                           runat="server" ID="Label2"/>
+		   </ItemTemplate>
+		   <SeparatorTemplate>
+			<br>
+		   </SeparatorTemplate>
+	      </asp:DataList>
+              <asp:Button id="BtnFill" style="Z-INDEX: 101; LEFT: 200px; 
+                   POSITION: absolute; TOP: 296px" runat="server"
+		   Text="Fill" OnClick="BtnFill_Click" 
+                   Width="64px"></asp:Button>
+	</form>
+	</body>
+</HTML>