asp.net - Load values from database using SQL and repeater control -
I have a database file with the "Champions League" group, with information the table looks like this for example: "The team Team: Arsenal London, Group: A; Team: FC Barcelona, Group B; Team: Manchester City, Group: Real Madrid, Group: A, Team: Manchester UTV, Group: A; Team: Chelsea London, B: Team: Atletico Madrid, Group: B; Team: Juventus, Group: B; "
OleDbConnection Thief = New OleDbConnection: etc. At this time, Day To render HTML tables for Tabs I'am groups using 8 repeaters (each one for each group), and to get the value from the code (); Con.ConnectionString = "provider = Microsoft.Jet.OLEDB.4.0; data source = D: /VisualWebSitesProject/EURO-PILKA/bazyDanych/ligi.mdb"; Con.Open (); Dataset ds = new dataset (); OleDbDataAdapter da = New OleDbDataAdapter (); Da = new OleDbDataAdapter (like "an order based on DESC points from selectively * ChampionsLeague WHERE group", Kon); Da.Fill (DS); GroupA.DataSource = DS; GroupA.DataBind (); Con.Close (); Con.Open () Dataset DS2 = new dataset (); OleDbDataAdapter da2 = New OleDbDataAdapter (); Da2 = New Olead Batata adapter ("Select Group from Champions League, where B order like DAC Points", Conn); Da2.fill (DS2); GroupB.DataSource = ds2; GroupB.DataBind (); Con.Close ();
And for the rest of the group, this ethical works fine, but i'am is thinking: Is there a better way of doing this? Without using so many repeaters or datasets? I'am is worried about this, because I also want to create a "World Cup" group (8 reporter), and "Europa League" group (12 repeaters) and I think the page will be loaded very slowly .. < / P>
Repeater creation:
& lt; ASP: Repeater ID = "Group A" Runat = "Server" & gt; & Lt; HeaderTemplate & gt; & Lt; Div class = "wygladNaglowekTabele wygladNaglowekTabeleOnload" & gt; Group A & lt; / Div & gt; & Lt; Table id = "liga" class = "wygladTabelaLiga" & gt; & Lt; TR & gt; & Lt; Td class = "szerokosc1 color3" & gt; L.P. & Lt; / TD & gt; & Lt; Td class = "szerokosc2 color3 wysrodkuj" & gt; DRUZYNA & lt; / TD & gt; & Lt; Td class = "szerokosc1 color3" & gt; LM & lt; / TD & gt; & Lt; Td class = "szerokosc1 color3" & gt; B & lt; / TD & gt; & Lt; Td class = "szerokosc1 color3" & gt; Issue & lt; / TD & gt; & Lt; / TR & gt; & Lt; / HeaderTemplate & gt; & Lt; ItemTemplate & gt; & Lt; TR & gt; & Lt; Td class = "szerokosc1 color 2" & gt; & Lt;% # Container.ItemIndex + 1%> & Lt; / TD & gt; & Lt; Td class = "szerokosc2 color 2" & gt; & Lt;% # Eval ("Team")% & gt; & Lt; / TD & gt; & Lt; Td class = "szerokosc1 color 2" & gt; & Lt;% # Eval ("LiczbaMeczy")%> & Lt; / TD & gt; & Lt; Td class = "szerokosc1 color 2" & gt; & Lt;% #Eval ("LiczbaGoliStrzelonych")%> & Lt; / TD & gt; & Lt; Td class = "szerokosc1 color 2" & gt; & Lt;% # Eval ("Points")%> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / ItemTemplate & gt; & Lt; AlternatingItemTemplate & gt; & Lt; TR & gt; & Lt; Td class = "szerokosc1 color" & gt; & Lt;% # Container.ItemIndex + 1%> & Lt; / TD & gt; & Lt; Td class = "szerokosc2 color" & gt; & Lt;% # Eval ("Team")% & gt; & Lt; / TD & gt; & Lt; Td class = "szerokosc1 color" & gt; & Lt;% # Eval ("LiczbaMeczy")%> & Lt; / TD & gt; & Lt; Td class = "szerokosc1 color" & gt; & Lt;% #Eval ("LiczbaGoliStrzelonych")%> & Lt; / TD & gt; & Lt; Td class = "szerokosc1 color" & gt; & Lt;% # Eval ("Points")%> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / AlternatingItemTemplate & gt; & Lt; FooterTemplate & gt; & Lt; / Table & gt; & Lt; / FooterTemplate & gt; & Lt; / ASP: Repeater & gt;
Thanks for any advice! And I'm sorry for my english.
You can get all the groups in a call And make the last HTML tag programmatically in a stringbuilder, then put the stringbilder string in the control such as asp: litle
Comments
Post a Comment