Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0CBO.FillCollection. Parent/Child Relationship between 2 tablesCBO.FillCollection. Parent/Child Relationship between 2 tables
Previous
 
Next
New Post
3/1/2007 12:34 PM
 

Hi,

I am hoping to get some info on using the CBO and executing more than 1 Stored Procedure (or getting data for 2 tables in one Stored procedure). I am trying to develop a nested Repeated view of data based on a Parent Child Relationship between 2 Tables. I have written a small application to test this using the following;

 

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

     
        Dim cnn As New SqlConnection("Data Source=localhost;Initial Catalog=dbName;User ID=sa;password=")

        Dim cmd1 As New SqlDataAdapter("select * from ps_calls", cnn)

        'Create and fill the DataSet.
        Dim ds As New DataSet()
        cmd1.Fill(ds, "PS_Calls")

        'Create a second DataAdapter for the Titles table.
        'Dim cmd2 As New SqlDataAdapter("select * from ps_calls S1,ps_service S2 where S1.Policy_Number=S2.Policy_Number and S1.PS_Number = S2.PS_Number ", cnn)
        Dim cmd2 As New SqlDataAdapter("select * from ps_service", cnn)
        cmd2.Fill(ds, "PS_Service")

        'Create the relation bewtween the Authors and Titles tables.

        ds.Relations.Add("myrelation", ds.Tables("PS_Calls").Columns("PS_Number"), ds.Tables("PS_Service").Columns("PS_Number"))

        'Bind the Authors table to the parent Repeater control, and call DataBind.
        parent1.DataSource = ds.Tables("PS_Calls").DefaultView
        Page.DataBind()

        cnn.Close()
end sub

And all works when I present the data on my aspx page.

What i want to do is replicate this using the DNN built in CBO, but I'm not sure if its possible or if I'm going in the right way.

PolicyServicingController.vb

Return (CBO.FillCollection(Of PolicyServicingInfo)(DataProvider.Instance().GetPolicyServicings(sPolicyNumber, sPolicySearch)))

SqlDataProvider.vb

 

Public Overrides Function GetPolicyServicings(ByVal sPolicyNumber As String, ByVal sPolicySearch As String) As IDataReader

 

spParams(0) =

spParams(1) =

Dim spParams(1) As SqlParameterNew SqlParameter("@sPolicyNumber", sPolicyNumber)New SqlParameter("@sPolicySearch", sPolicySearch)

Return CType(SqlHelper.ExecuteReader(ConnectionString, "S1Test..sp_Portal_Search_PolicyServiceCalls", spParams), IDataReader) -PARENT

Return CType(SqlHelper.ExecuteReader(ConnectionString, "S1Test..sp_Portal_Search_PolicyServiceDetails", spParams), IDataReader) 'CHILDEnd Function

 

If someone has any info of using repeater rows in DNN and displaying the data on the page I would appreciate it.

Thanks,

Robert

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0CBO.FillCollection. Parent/Child Relationship between 2 tablesCBO.FillCollection. Parent/Child Relationship between 2 tables


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out