.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Forum >> .NET Framework >> Post New QuestionBookmark and Share Subscribe to Forum

how to create relation in a table

Posted By: siri.k     Posted Date: July 09, 2011    Points:5   Category :.NET Framework
I have this query can any one tell me how to create relation of company table with this

Private Sub Report2()
Dim ds As New DataSet()
Dim dt As New DataTable()
dt1 As New DataTable()
Dim dt2 As New DataTable()
Dim st1 As String = "SELECT Level_ID, Level_Name, SUM(LastYear_Sale) AS LastYear_Sale, SUM(Planned_Sales) AS Planned_Sales, SUM(LY_PCM_Value) AS LY_PCM_Value, " & _
"SUM(CY_PCM_Value) AS CY_PCM_Value, SUM(LY_IMU_Value) AS LY_IMU_Value, SUM(CY_IMU_Value) AS CY_IMU_VALUE " & _
"FROM tbl_Merchandise_Plan " & _
"GROUP BY Level_ID, Level_Name "

st1 += "SELECT Level_ID, Level_Name, Year_Month, LastYear_Sale, Growth_Per, Planned_Sales, LY_Contribution, Planned_Contribution, LY_PCM_Per, " & _
"LY_PCM_Value, CY_PCM_Per, CY_PCM_Value, LY_IMU_Per, LY_IMU_Value, CY_IMU_Per, CY_IMU_Value " & _
"FROM tbl_Merchandise_Plan " & _
"ORDER BY Level_No, Year_No, Month_No"

i have this query can any one tell me how to create relation of companytable with this

Author: Sasi Prabhu             
Posted Date: July 09, 2011     Points: 20   

Create a view using join Queries
Select the required field from the views.

Thanks & Regards,
Sasi Prabhu.
Author: Gowthammanju             
Posted Date: July 11, 2011     Points: 20   

U can use views in sql server which resolves ur solution

Thanks & Regards,

Mark if the answer is true
Author: Ravi Ranjan Kumar             
Posted Date: July 11, 2011     Points: 20   
Author: Narayanan             
Posted Date: July 12, 2011     Points: 20   

create a view and call that view in your code

Regards, Lakshmi Naraayanan.S

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend