What is wrong in my code?????????

I would like to return ALL ITEMES in a column by this way. 

Where is wrong in my code??
Please help (without using "asp:Repeater"!)

<!-- #INCLUDE FILE="..\include.aspx" -->
<script language="VB" runat="server">
dim mypagename as string
Sub Page_Load(sender As Object, e As EventArgs)
Dim query As String = "Select * FROM tblPages where id>0"
Dim myConn As OdbcConnection = gooz
Dim myCmd As New ODBCCommand(query,myConn)
myConn.Open()
Dim myReader As ODBCDataReader = myCmd.ExecuteReader()
Do While myReader.Read()
mypagename = (myReader("pagename").tostring)
Loop
myReader.Close()
myConn.Close()
myConn = Nothing
End Sub
</script>
<html><body>
<%=mypagename%><br>
</body></html>

0
hamtad
8/19/2004 9:47:21 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
433 Views

Similar Articles

[PageSpeed] 15

hamtad,

Within your loop, you are resetting 'mypagename' (overwriting the last value each time) . You need to concatenate/append the value to the variable 'mypagename'. This will append all of the values separated by a "<br>":

Do While myReader.Read()
mypagename &= myReader("pagename").ToString & "<br>"
Loop

HTH,
cjmaxey
0
cjmaxey
8/19/2004 10:05:27 PM
Reply:

Similar Artilces:

Setting width for .net controls in code(.aspx) page using function call in code behind..
Hi,  Currently I am trying to set the width of the asp.net Table as follows. <asp:Table width="<%=GetWidth()%>" >   and code behind protected Unit GetWidth() { return Unit.Percentage(50); }     It's not working. I know that it works if I set the width complete on some page event(like page_load) of code behind....   Is there a way to maintain the same syntax like calling code behind function in design page...i.e. calling function of .aspx.cs in .aspx page and assign the width as shown above.   Thanks and regards, Giridhar...

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

Translate c#.net code to vb.net code
Hi I can usually do the translation myself, but this time I am a bit stumped  Let us consider to rewrite Urls (more than 16000 links) using a table. Save original url and rewritten url in a table. Now add a class file in App_Code folder. class UrlRewriteModule : IHttpModule{    public void Dispose()    {        // Nothing to dispose    }    public void Init(HttpApplication context)    {        context.BeginRequest += new EventHandler(context...

How to convert C#.Net code to VB.Net code ???...
HI, i was searching something new, then i suddenly find some tips to convert C#.Net code to VB.Net but i did not do well. i am puttint its url here plz tell me how to convert C#.Net code to VB.Net. http://www.dotnetspider.com/code/C-273-Convert-C-VB-NET.aspx Jasim...Please remember to click “Mark as Answer” on the post that helps youJasim AkhtarNew Delhi ( INDIA ) It would be better if you write the problem you having, while converting from C# to VB.NET. You cannot completely rely on online converters. ThanksMark post(s) as "Answer" that helped youElectronic ScrewWebsite||Bl...

What is wrong with my Control collection codes?
I use C# implement one of ASP.NET page containing ListBoxs, DropDownLists and TextBoxs. In Page_load event I first check it is not postback then tried to run following codes if Ctrl is ListBox or DropDownList in foreach statement then I will do something. But two if statements never get true. What is wrong with my codes? Thanks!  foreach(Control Ctrl in this.Controls){       if (Ctrl is ListBox)      { ListBox lstBox = (ListBox)Ctrl; str = Ctrl.ID;       }      else i...

What is wrong with this user control code
I have a method behind a user control. The method simply display text in a label on the user control. Public Sub BuildPage() Dim strTest As String Try objMyData = New CreateDataForDisplay strTest = objMyData.DataGrab lblHTML.Text = strTest objMyData = Nothing Catch ex As Exception Throw New Exception("Error LeftNav Module: " & ex.Message, ex) End Try End Sub The methos it calls is: Public Class CreateDataForDisplay Public Function D...

How to control embded .net code in javascript?
There is a javascript function in aspx page and try to call a .NET code function:   function test(){              var yesno;     yesno = <%=CallYesno()%>;   } The .Net function is:Public Function Yesno() As BooleanEnd Function  When you load the page , it always executeYesno function even you never call test function. Why? How to solve this issue? Hi, the simple idea in a ASP.NET request/response is that server--side code runs before client-side code. E.g the server-side cod...

.net 2.0 login control code?
Ok, so the 2.0 has a login control amonst others. Anyone know if the source is available or will be available? I am trying to replicate what it does in 1.1 I need a good login control that I can customize. I am still a beginner in .net and learning fast....

What's wrong with this tab control code ?
 Hi I found this combination of FormView & Tab Control DID insert a new record but it is a blakn record that it dadded !! It works before I put in the tab structure. Could someone look at this code and show me where is wrong ? VS2008 keeps saying Script Manage is needed but I have it there as seen in the code. Pls help. Thanks function pageLoad() { } '>'>'>'>'>'> <%@ Page Language="VB" %> <%@ Register assembly="AjaxControlToolkit" namespace=&qu...

WRONG WRONG WRONG
Name: ROZ mandelcorn Email: thunderstaratearthlinkdotnet Product: Firefox Summary: WRONG WRONG WRONG Comments: as a long-time user, first of netscape and, mozilla firefox, i must say i DO NOT LIKE THE PLACEMENT of TABS in version 4. nor do i like the whole rearrangement of the upper/navigation portion of firefox. I NEED/WANT MY TABS DIRECTLY ABOVE MY WINDOWS AS IT IS NOW....NOT ON TOP OF THE BROWSER. I WANT MY FILE-EDIT-ETC-MENU on TOP. ETC. AT LEAST GIVE US THE CHOICE AS TO WHICH FORMAT WE WANT....CAN YOU SAY CUSTOMIZATION! I WILL NOT USE 4 IF THIS IS THE WAY IT IS. [just ...

What's wrong in my VB.NET code?
Dear all, I'm trying to write the code for a "login" button, to check if the username & password is correct or not and if it's correct check the type, because I have 3 types of users, and each case there should be an update but it's not updating, please check my code below and tell me what's wrong? why it's not updating in the database? I'm using ASP.NET 2003 and SQL 2000.Private Sub login_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login_btn.Click CheckAccess() End Sub  Private Sub CheckAccess() Dim type A...

Coding in a Repeater control in .NET 2.0
I have a repeater control listing records from a database.  For each record, I want to check the value of a field. Part of what gets printed will depend on the value of the field.  So far I have the following, which is working.  What I want is for th second line to say one thing if ReNewAd has a value, ans something else if it doesn't.  <asp:Label runat="server" ID="LabelFirstLine"> <p><a href='Template.aspx?i=<%# Eval("File2")%>'><%# Eval("Last Name")%>, <%# Eval("First Name")%> </a> - <%# Eval("City")%>, <%# Eval(...

programatically create html-code and .net controls
Hi i have a problem. I want to create a webform programatically and put a textbox inside a <td>-tag. This is how i tried to do but its not working: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Response.Write("<html><head>................................<td>") Dim txtBox as New TextBox txtBox.ID = "myBox" Me.Controls.Add(txtBox) Response.Write("</td>...................................</html">) End Sub Can someon...

Code generation in Microsoft.net ( code that writes code ) Whats its future
Hello, I was just reading a book about Code Generation in .NET. Its damn hard book to read. What do u think is the future of Code GenerationHighOnCodingWanna get high! It's being used now quite a bit. Not necessarily out the box click a button, and you get an application, but applications will generate specific code to function dynamically.Kay LeeMySpace.com - http://www.myspace.com/kragieInfrastructure GroupMySpace.com- Code to live, but Live to code. the refactoring tools already available (and those that are destined for the new IDE) use the same techniques. we will pr...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

Web resources about - What is wrong in my code????????? - asp.net.presentation-controls

Code - Wikipedia, the free encyclopedia
"Decoded" redirects here. For the television show, see Brad Meltzer's Decoded . For the Jay-Z memoir, see Decoded (book) . A code is a rule for ...


Herding Code
While at NDC 2012 in Oslo, Jon and K. Scott talked to Shay Friedman about Roslyn, IronRuby, and the DLR. Download / Listen: 146 – Shay Friedman ...

iPhone, iPad and Mac OS X Cocoa Usability and Development Services - Instinctive Code
iPad, iPhone / iPod Touch and Mac OS X Cocoa development services and UI design.

Re/code
No Bible Available? NY Swears in Politician With iPad Bible App. By Jordan Kahn, Writer, 9to5Mac

Researchers confirm backdoor password in Juniper firewall code
The Juniper NetScreen 5200, one of the firewalls that carries the backdoor code inserted into Juniper's ScreenOS. On December 17, Juniper Networks ...

Loot Crate November 2015 Review and Coupon Code
... full of fun and unexpected gamer swag. Does this month’s Loot Crate look drool worthy to you? Sign up for Loot Crate below and use coupon code ...

My Christmas wish—a 212 area code
What does this New Yorker and entrepreneur want for Christmas? A 212 area code. Here's how you get one.

Cisco launches code review after Juniper's spyware disclosure
Computerworld Cisco launches code review after Juniper's spyware disclosure Computerworld Cisco Systems has launched an internal code review ...

Cisco launches code review after Juniper's spyware disclosure
CSO Online Cisco launches code review after Juniper's spyware disclosure CSO Online Cisco Systems has launched an internal code review following ...

Resources last updated: 12/25/2015 2:44:11 AM