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