Advertisement

12.31.2007 at 07:08PM PST, ID: 23051636
[x]
Attachment Details

How to Create a new datatable from multiple tables

Asked by jlrray in Microsoft Visual C#.Net, Microsoft Visual Studio Express, Visual Studio .NET 2005

Tags: C#.NET , ADO, SQL

Utilizing SQL Server 2005 and C#.NET 2005 or 2008 how can I create a new dataset and view that in a datagridview or something.  Here is the SQL i have and it seems to work correctly using the SQL Manager, but I'm at a loss as to how to view it in my project.


Start Free Trial
1:
2:
3:
4:
5:
6:
7:
SELECT tblPersonnel.pLastName, tblPersonnel.pFirstName, tblPersonnel.pMiddleInitial, tblEmployer.empName, tblPositions.sPosition
 
FROM tblPersonnel
INNER JOIN tblEmployer ON tblPersonnel.employerID = tblEmployer.empID
LEFT OUTER JOIN tblPositions ON tblPersonnel.pPrimaryAssignment = tblPositions.sPositionID
 
WHERE (tblPersonnel.pStatus = @status) AND (tblPersonnel.pPrimaryAssignment = @priassignment)
[+][-]01.01.2008 at 02:30AM PST, ID: 20559251

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.01.2008 at 08:40AM PST, ID: 20560582

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.01.2008 at 12:58PM PST, ID: 20561372

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Microsoft Visual Studio Express, Visual Studio .NET 2005
Tags: C#.NET , ADO, SQL
Sign Up Now!
Solution Provided By: JimBrandley
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.01.2008 at 02:00PM PST, ID: 20561549

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.04.2008 at 07:29PM PST, ID: 20587676

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628