RE: Creating Repeater control dynamically

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bill Borg (anonymous_at_discussions.microsoft.com)
Date: 03/24/04


Date: Tue, 23 Mar 2004 18:46:09 -0800

Hi Randall, sorry, I'm just not getting it. Can you tell me in high-level (i.e. end user) terms what you're trying to accomplish, like the guy selects a category from a dropdown, you show some data, etc. I'm wondering if what you're trying to achieve is a grid-like thing where each row has a dropdown, and when you select that dropdown the rest of the row fills out in a format specific to that type of selection? Were that the case, you might want something other than a repeater.
     
     ----- Randall wrote: -----
     
     Hi Bill,
     
     Thanks for replying back to me.
     
     Here is the scenario.
     
         commandString1= " Select TC.CategoryID, T.TopicName, C.name from tblTopicsToCategories TC, viewTopics T , tblCategory C where TC.TopicID = T.TopicID and TC. Categoryid= C.CategoryId and T.TopicName = '"+CMSContext.Posting.DisplayName +"' ORDER BY TC.SortOrder";
                             connection.Open();
     
      System.Data.SqlClient.SqlCommand command=new System.Data.SqlClient.SqlCommand(commandString1,connection);
                             SqlDataReader dataReader1 = command.ExecuteReader();
                 
                             while (dataReader1.Read())
                             {
                             CategoryId=dataReader1.GetSqlInt32 (0).ToString ();
                             CategoryName=dataReader1.GetString(2);
                             
                             commandString2 = "SELECT PC.categoryID , C.name , S.county, P.programTitle FROM tblSession S, tblProgram P, tblProgramCategory PC, tblCategory C WHERE S.programId = P.programId and P.programID = PC.programID and PC.categoryID = C.categoryID and county='montgomery' and C.CategoryId ='"+CategoryId+"
     
     SqlDataAdapter dataAdapter= new SqlDataAdapter(commandString2,connectionString);
                                     DataSet dataSet=new DataSet();
                                     dataAdapter.Fill(dataSet,"tblSession");
                                     DataTable dataTable= dataSet.Tables[0];
                                     Repeater1.DataSource=dataTable;
                                     Repeater1.DataBind();
                             }
     
     What happens here that for each value from the first query I need to have a separate display but in this case it is overwritten because I am using one repeater control.
     
     Any suggestion?
     I appreciate your help.
     
     Regards,
     Randall



Relevant Pages

  • RE: Creating Repeater control dynamically
    ... Thanks for replying back to me. ... Here is the scenario. ... SqlDataAdapter dataAdapter= new SqlDataAdapter; ... What happens here that for each value from the first query I need to have a separate display but in this case it is overwritten because I am using one repeater control. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: More older Americans signing on to volunteer abroad
    ... Bill, lets just hope that this doggoned swine flu doesn't get out of hand! ... A virus that wiped out half the global population might not be a totally bad scenario since it would allow the survivors to re-evaluate being over crowded and killing the planet. ... You can do all possible to stay healthy and still something can take you at any time. ... A horrible diet all his life and no systematic exercise, just a lot of yard work and such. ...
    (soc.senior.issues)
  • Re: "Gun control laws (in the USA) have for too long been overly permissive and not conducive to a s
    ... Poor old Bill boy thinks a situation with only ... >>> one variable (a couple of bad guys with bats) covers all bases. ... >> attackers, (no special forces team on your side and you are not ... No, extra info, Phil, just a different scenario. ...
    (talk.politics.guns)
  • Re: Unusual incompatibility between Office X for Macintosh and Office
    ... Many thanks to both you and BIll for replying, but before I posted, I ... searched the group for pointers as to any known compatibility issues. ...
    (microsoft.public.powerpoint)
  • Re: OT: Building my HTPC
    ... Merely sticking with the style of the post I was replying to. ... You wanna get a nice Linux irony meter, ... I'll send a bill to Bill for all that time I spent with a registry editor trying to crowbar something either in or out. ... OpenOffice supports all I need on that front, I don't play games, so a linux distro beats whatever an XP license costs and I don't have to worry about changing hardware. ...
    (uk.rec.motorcycles)