Yeah_vbulletin3_import38740
New Member
It was hard to find the correct question topic. Well, let me elaborate more. I'm making a barcode generator simple webapp. It is for our warehouse team.I made a class named \[code\]SqlComm\[/code\] where I handle all \[code\]SQL\[/code\] connection related thing. Then, I have a query (the query is just about counting a column where some Date in between). I use the query for setting the \[code\]array\[/code\] size. Later, it loops through a \[code\]for\[/code\] cycle and adds each new label to a placeholder. Sadly, the placeholder is not showing my new labels just created.c# (codebehing)\[code\] int index = 0; int iLength = 0; dt = SqlComm.SqlDataTable("SELECT [Lenum] FROM [SUIDonMachineTable] WHERE MachineTimestamp BETWEEN CONVERT(datetime,'"+strDayFrom+"', 121) AND CONVERT(datetime,'"+strDayTo+"', 121) AND Station ='NG08NX1BT'"); object obj = new object(); obj = SqlComm.SqlReturn("SELECT COUNT (Lenum) FROM [SUIDonMachineTable] WHERE MachineTimestamp BETWEEN CONVERT(datetime,'"+strDayFrom+"', 121) AND CONVERT(datetime,'"+strDayTo+"', 121) AND Station ='NG08NX1BT'"); iLength = Convert.ToInt32(obj); Label[] labels = new Label[iLength]; for (index = 0; index == iLength; index++) { labels[index] = new Label(); labels[index].Text = (string)dt.Rows[index]["Lenum"]; PH.Controls.Add(labels[index]); }\[/code\]asp.net (placeholder part)\[code\]<asplaceHolder ID="PH" runat="server"></asplaceHolder>\[/code\]