473,804 Members | 3,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 GetResultsSubmi ssion(ByVal _CP As String, ByVal _CB As
String, ByVal _BlkID As Integer, Optional ByVal _cUser As String = "") As
dsRESULTSsubmis sion

Dim tables(1) As String
tables(0) = "vwMLSISFor mC"
tables(1) = "TDT_MILESTONE_ DECLARATIONS"

Dim ds As New dsRESULTSsubmis sion

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.FillD ataset(SqlDbMan ager.GetConnect ionString, _
CommandType.Sto redProcedure, "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.FillD ataset(SqlDbMan ager.GetConnect ionString,
CommandType.Sto redProcedure, _
"Milestones_Rea d", ds, tables, sqlPar4)
Catch ex As Exception
Debug.WriteLine (ex.Message)
End Try

Return ds

End Function
Jul 21 '05 #1
0 965

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

Similar topics

6
2884
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 a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
1
1869
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 have seen examples of to use dataset, datagrids, but how can I populate textboxes and label's with the results of my stored procedure?
0
2598
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 tablestyles to format any of the columns within the datagrid, the exception "Can-not parent objects created on one thread to objects created on another" or words to that effect. I'm not too sure if what I said make sense, but i will add details to...
0
841
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) 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...
3
6045
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 "LabLocation_ID". With an existing lab, they then need to add the members for that lab. So, what I am trying to do is the following. With the FormView of the Lab open, the user will click a button to open a FormView (InsertMode) and add a new...
6
14315
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 table also contains a field for photographerID which is used to join the two tables. I'm having problems with populating a dropDownList using the complete set of photographerNames and IDs from the 'photographer' table but
2
1631
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
1730
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 reference of micrososft Sub PopulateNode(ByVal sender As Object, ByVal e As TreeNodeEventArgs) ' Call the appropriate method to populate a node at a particular level. If e.Node.ChildNodes.Count = 0 Then Select Case...
0
3251
JordanMartz
by: JordanMartz | last post by:
''' <summary> ''' Populates the DataGridView ''' </summary> Private Sub PopulateDataGridView() ' Set the column header names. userAccessGrid.ColumnCount = 5 userAccessGrid.RowsDefaultCellStyle.BackColor = Color.White userAccessGrid.RowHeadersVisible = True userAccessGrid.Name = "User Access Grid" userAccessGrid.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.