2 Replies - 403 Views - Last Post: 03 April 2013 - 08:25 AM Rate Topic: -----

#1 Black_Lion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 13

Select 2 columns from 2 tables display on grid

Posted 03 April 2013 - 07:47 AM

Hey guys. I am trying to SELECT columns from two tables so that I can display their columns on a single GridView (using SqlDataSource).

The 2 tables I am using is the aspnet_Membership (wanting to just SELECT username and email) and a Venue table (SELECT Tel, Date, Menu etc).

The reason I didn't use 1 table (adding the username and email column to Venue table), is because these columns are being used to allow users to register and log into their account under the Membership Class, which I feel is easier and faster. Help would be much appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Select 2 columns from 2 tables display on grid

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8374
  • View blog
  • Posts: 31,122
  • Joined: 12-June 08

Re: Select 2 columns from 2 tables display on grid

Posted 03 April 2013 - 07:51 AM

Typically one would use a 'join' on a common key to get data from two different tables. Without knowing your table structure I would suggest investigating 'joins' in general.
Was This Post Helpful? 0
  • +
  • -

#3 Anthonidas  Icon User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 215
  • Joined: 25-April 11

Re: Select 2 columns from 2 tables display on grid

Posted 03 April 2013 - 08:25 AM

This might help you: http://msdn.microsof...v=sql.105).aspx
or this: http://dev.mysql.com....0/en/join.html

EDIT:
Didn't see that modi123_1 had already answered. ;)/>

This post has been edited by Anthonidas: 03 April 2013 - 08:28 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1