473,371 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,371 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 932

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
1
by: MicroMoth | last post by:
I know that this is probably a simple question, but I can't seem to find out how to populate the form fields I have with the results from my stored procedure, which I have stored in a datase. I...
0
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create...
0
by: amber | last post by:
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)...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
6
by: p.mc | last post by:
Hi all, I have a MS SQLServer database which has two tables, 'images' and 'photographers'. The photographer table contains a field for PhotographerID and a one for PhotographerName. The image...
2
by: MMA | last post by:
How do I populate the menu control in 2.0 from a database. I know this can be done with the Tree Control. Any code snippets? Thanks in advance.
0
by: teju | last post by:
Hi all, I am trying to populate tree view from the database. Till two levels i can populate it fine but when it reaches third level it doesn't expand. Below is the code, it has been taken from the...
0
JordanMartz
by: JordanMartz | last post by:
''' <summary> ''' Populates the DataGridView ''' </summary> Private Sub PopulateDataGridView() ' Set the column header names. userAccessGrid.ColumnCount = 5 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.