471,321 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

populating a dataset from 2 tables

I've been trying to figure out how to get 2 datasets to populate a
report/subreport - and I think I'm on the right track...just having a few
problems somewhere...

I have created a dataset (.xsd) consisting of 2 tables - one is coming from
a table in SQL, the other from a view.

The 1st table is populating correctly , but the 2nd isn't.
I'm assuming I can't populate my dataset twice and have it work properly.
Am I even on the right track with my code? (pasted below)

Public Function GetResultsSubmission(ByVal _CP As String, ByVal _CB As
String, ByVal _BlkID As Integer, Optional ByVal _cUser As String = "") As
dsRESULTSsubmission

Dim tables(1) As String
tables(0) = "vwMLSISFormC"
tables(1) = "TDT_MILESTONE_DECLARATIONS"

Dim ds As New dsRESULTSsubmission

Dim sqlPar1 As New SqlParameter("@CP", SqlDbType.Char)
sqlPar1.Value = _CP
Dim sqlPar2 As New SqlParameter("@CB", SqlDbType.Char)
sqlPar2.Value = _CB
Dim sqlPar3 As New SqlParameter("@cUser", SqlDbType.Char)
sqlPar3.Value = _Cuser
Dim params() As SqlParameter = {sqlPar1, sqlPar2, sqlPar3}

Try

ds.Clear()
SqlHelper.FillDataset(SqlDbManager.GetConnectionSt ring, _
CommandType.StoredProcedure, "FormC_read", ds, _
tables, params)

Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try

Dim sqlPar4 As New SqlParameter("@BlockID", SqlDbType.Char)
sqlPar4.Value = _BlkID

Try
SqlHelper.FillDataset(SqlDbManager.GetConnectionSt ring,
CommandType.StoredProcedure, _
"Milestones_Read", ds, tables, sqlPar4)
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try

Return ds

End Function
Jul 21 '05 #1
0 863

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Chris Leuty | last post: by
1 post views Thread by MicroMoth | last post: by
reply views Thread by amber | last post: by
6 posts views Thread by p.mc | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.