Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 13th, 2004, 02:35 PM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default Binding multiple db tables to dataset (union)

Hi to all!

I want to add the result of following sentence to one dataset:

cmd = new SqlCommand("SELECT v.vis_cod_paciente as 'cod. paciente',pa.pac_nombre as 'nombre paciente', " +
        "v.vis_cod_personal as 'cod. doctor', p.per_nombre as 'nombre doctor', " +
        "v.vis_cod_fecha as 'fecha', v.vis_motivo as 'motivo' FROM visitas v " +
        "INNER JOIN PERSONAL p ON v.vis_cod_personal = p.cod_personal " +
        "INNER JOIN PACIENTES pa ON v.vis_cod_paciente = pa.cod_paciente " +
        "WHERE v.vis_cod_fecha='" + hoy.ToShortDateString() + "'", myConnection);

But I'd tried this:

daVisitas.SelectCommand = cmd;
daVisitas.Fill (dsAgendaVisitas, "VISITAS");
dataGrid1.SetDataBinding(dsAgendaVisitas,"VISITAS" );

..with no results at all.

The sentence works alone in a sql interpreter, but it doesn't in this way.

Anybody can help?

Thanks

-------------------------------
World only exists into your mind.
 
Old September 13th, 2004, 02:38 PM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh, sorry! It works... I was confused with another part of the program.

-------------------------------
World only exists into your mind.





Similar Threads
Thread Thread Starter Forum Replies Last Post
UNION of Tables neo_jakey Classic ASP Professional 2 January 31st, 2006 03:08 PM
Create a report from multiple tables in a Dataset verdun Crystal Reports 4 May 12th, 2005 09:20 AM
dataset with multiple tables Bhavin Crystal Reports 2 October 8th, 2004 09:18 AM
Binding multiple db tables to dataset Arsi C# 4 September 1st, 2004 11:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.