-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: bhavesh26
Message 12 in Discussion




  
    
    New Message on MumbaiUserGroup
  
  





      Distinct Color Filter in DataSet

    
  
    
      Reply

          
            
                
               
                  Reply to Sender
                    Recommend
                  
                  Message 8 in Discussion
                                                
            
          
        
                    
        
            
              From: 
              bhavesh26
            
            
              

              Hi Bobby,   I think following code will help you.   <asp:Repeater 
  ID="rptColor"  Runat="Server">
<ItemTemplate>
<h2><%# Container.DataItem( "Color" )%></h2>
<h1><asp:label id="lblcount" runat="server">       <%# 
CountColor(Container.DataItem( "colorName" ) )%></asp:label></h1>
</ItemTemplate>
</asp:Repeater>
</body>
</html>
 'server side code  
Dim ds As DataSet 
Dim dvwProducts As DataView 
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles MyBase.Load 
Dim con As SqlConnection 
Dim da As SqlDataAdapter 
ds = New DataSet 
con = New SqlConnection("Your Connection String") 
da = New SqlDataAdapter("Select Distinct Color >From NameOfYourTable", con) 
da.Fill(ds, "ColorMaster") 
da = New SqlDataAdapter("Select * From NameOfYourTable", con) 
da.Fill(ds, "ColorDetail") 
  
dvwProducts = ds.Tables("ColorDetail").DefaultView() 
rptColor.DataSource = ds 
rptColor.DataMember = "ColorMaster" 
rptColor.DataBind() 
End Sub 
Function CountColor(ByVal colorName As String) As Integer 
dvwProducts.RowFilter = "Color='" & colorName & "'" 
Return dvwProducts.Count 
End Function If you still have problem let me know.   regards, Bhavesh Patel    
          
        
      
          
  

    View other groups in this category.
  

  

      




-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to