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

New Message on BDOTNET

-----------------------------------------------------------
From: Sitaraman
Message 6 in Discussion

Hi   I think Bhavtosh meant compute and not select. The sample code is as follows.  
The second argument to compute is a filter, which i think u do not need.       Dim 
l_objDataset As New DataSet()
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles Button1.Click
        fnAddRows() ' Call a function which wil add a table to the dataset,  2 columns 
to the table and five dummy rows to the table
        MsgBox(l_objDataset.Tables(0).Compute("Sum(Amount)", ""))
    End Sub 
    Private Function fnAddRows() As Integer         l_objDataset.Tables.Add()
        l_objDataset.Tables(0).Columns.Add("ID")
        l_objDataset.Tables(0).Columns.Add("Amount", 
System.Type.GetType("System.Int16"))
        Dim l_objDatarow As DataRow         l_objDatarow = 
l_objDataset.Tables(0).NewRow
        l_objDatarow(0) = "A"
        l_objDatarow(1) = 1
        l_objDataset.Tables(0).Rows.Add(l_objDatarow)         l_objDatarow = 
l_objDataset.Tables(0).NewRow
        l_objDatarow(0) = "B"
        l_objDatarow(1) = 2
        l_objDataset.Tables(0).Rows.Add(l_objDatarow)         l_objDatarow = 
l_objDataset.Tables(0).NewRow
        l_objDatarow(0) = "C"
        l_objDatarow(1) = 3
        l_objDataset.Tables(0).Rows.Add(l_objDatarow)         l_objDatarow = 
l_objDataset.Tables(0).NewRow
        l_objDatarow(0) = "D"
        l_objDatarow(1) = 4
        l_objDataset.Tables(0).Rows.Add(l_objDatarow)         l_objDatarow = 
l_objDataset.Tables(0).NewRow
        l_objDatarow(0) = "E"
        l_objDatarow(1) = 5
        l_objDataset.Tables(0).Rows.Add(l_objDatarow)         Return 
l_objDataset.Tables(0).Rows.Count
    End Function   hope this helps   regards,   sr

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

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_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