View Single Post
  #1 (permalink)  
Old October 18th, 2013, 08:11 PM
John S John S is offline
Authorized User
Points: 179, Level: 3
Points: 179, Level: 3 Points: 179, Level: 3 Points: 179, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Underlying SQL Query

Hello,

I can start a New Project and connect to an existing .mdf database, and display the tables from the database in the Database Explorer and Data Source windows.

I can drag a table to the IDE, but how do I access the actual SQL query that is being displayed?

I would like to modify it to join my tables and then display them.

I already have the relationships made with primary and foreign keys by using SQL Management studio, but would like to modify the Query used in the IDE to add the INNER JOINs.

That is, I would like to change:

Code:
SELECT serial_number, location, inspection_date FROM items
that the IDE is using, to:


Code:
SELECT c.item_name, i.serial_number, c.manufacturer, i.location, i.inspection_date

FROM catalog_item c INNER JOIN item i
ON c.item_id = i.item_id
I can figure out the SQL code, but where do I insert it into Visual C# IDE?

thanks