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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How do i link, a tables that have compisite keys?

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :Sql Server

hi friends,

i have the following table structure:




 at the moment i cannot link the table Sales and Invoices. i tried to drag and drop the sle_idx from Sales to Invoices' sle_idx but it shows incorrect information in the dialog box, the primary key table should be Sales but instead it shows Invoices , therefore how do i fix this problem?



View Complete Post

More Related Resource Links

How to display related tables in one crystal report and how to link this report with combobox?


Hi! I want to display a crystal report in my vb.net application. Suppose I have tables named student details, student marks, student address, etc... Now if I want to display all these details (fields of all tables) in one crystal report (with page breaks if necessary) then how will I achieve it. I will be providing a combo box in my application that contains list of student names. How can I link this combo box with the cystal report to dynamically display report for different student on selected index change of combo box? Help me friends. An example would be appreciable.

Denormalising dimension tables with multiple foreign keys


In SSAS 2008 I am trying to "denormalise" 2 source dimension tables into a single dimension.   The main table has 2 FKs to the other  parent table which I am trying to merge in.   What I have done so far is to make 2 copies of the parent table attributes in the dimension and name them accordingly.   Then I set the attribute relationships to link each FK column to the appropriate set of parent columns.   i.e. ending up with something like this:

DIM KEY -> DIM FK1 -> FK1 parent columns

             -> DIM FK2 -> FK2 parent columns

I thought that would be enough for SSAS to realise that FK1 parent columns come via the table relationship involving FK1 and FK2 parent columns come via the table relationship involving FK2.

I was wrong!   When I look at the SQL generated when processing the dimension it seems to choose one of the FKs and uses the same FK when joining both times to the parent table.   i.e. something like:

SELECT DIM.FK1, parent.parent columns from DIM, parent where DIM.FK2 = parent.KEY

Is it possible to do what I am trying??

Nested table 'link' which inherits its namespace cannot have multiple parent tables in different n


Does anyone know what I need to do to get past this error?

The error is "Nested table 'link' which inherits its namespace cannot have multiple parent tables in different namespaces."

I get the error on this line:


 Protected Sub lstOpens_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim ConnectStr As String = _

        Dim ctu As String = GetCTU()
        Dim ctp As String = GetCTP()
        'check if user has ct's
        If String.IsNullOrEmpty(ctu) Then
            Exit Sub
        End If
        If String.IsNullOrEmpty(ctp) Then
            Exit Sub
        End If

        'this returns an xml info for selected Campaign (email)

        Dim sUri As String = "https://api.constantcontact.com" & Me.lstOpens.SelectedValue.ToString()
        Dim sAPIKey As String = "/////"

        'setup httpWebReqeust to send the request
        Dim address As New Uri(sUri)
        Dim theRequest As HttpWebRequest = TryCast(WebRequest.Create(address), HttpWebRequest)
        theRequest.Credentials = New NetworkCredential((sAPIKey & "%" & ctu), ctp)


Surrogate vs Natural Primary Keys - Data Modeling Mistake 2 of 10

In case you're new to the series I've compiled a list of ten data modeling mistakes that I see over and over that I'm tackling one by one. I'll be speaking about these topics at the upcoming IASA conference in October, so I'm hoping to generate some discussion to at least confirm I have well founded arguments.

The last post in this series Referential Integrity was probably less controversial than this one. After all, who can argue against enforcing referential integrity? But as obvious as surrogate keys may be to some, there is a good deal of diversity of opinion as evidenced by the fact that people continue to not use them.

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Visual Studio Shortcut Keys

The following tables describe the shortcut keys in the Microsoft Dynamics AX Debugger.

Temporary Tables - MS SQL Server

Usage of temporary tables in MS SQL Server is more developer friendly and they are widely used in development. Local temporary tables are visible only in current session while global temporary tables are visible across all sessions.

Temporary tables in SQL Server vs. table variables

When writing T-SQL code, you often need a table in which to store data temporarily when it comes time to execute that code. You have four table options: normal tables, local temporary tables, global temporary tables and table variables. I'll discuss the differences between using temporary tables in SQL Server versus table variables.

MSDN Abstract Classes Link

MSDN Reference For Abstract Clases

Using a trigger or anything else to populate two tables


Hi! I'm creating an application that's supposed to first add a record to table1, and then get the ID from that record to use when adding a record to table2, to be able to associate these two records with eachother.

The user gets to type in some values that goes to table1, and some values that goes to table2, but before the insert statement for table2 is executed i need the ID from the recently added record in table1. Some dude told me to use a trigger for the autopopulate purpose, but does that really work when i also need to save some values that's user input, and when those values doesn't get saved in table1?

Are there any other way to do this or can i send values to a trigger? I'm new to triggers and stored procedures, i don't have any particular knowledge of this, any help is appreciated!


Regards, Monsterbadboll

merging multiple tables in a single dataset to single table


 i have a stored procedure which returns three tables to a dataset ..... now i need to merge all three tables to a single table from d same dataset 

like dataset1 has table1 table2 and table3 .... i want all the three tabels to be merged into dataset1 itself .... instead of three diffrent tables so that i can show all three table data in a single datagrid  as a compact data and combination of 3 tables from d single dataset.....

can some1 help me please.....

SqlDataSource UpdateCommand using 2 tables


I have two tables

Trans  with fields TransID, Date, CustomerID and some other stuff

Customer with fields CustomerID, Name, TaxId

On the screen the user only sees the fields Date and Customer Name. CustomerID is behind the scenes only.


I'm using SqlDataSource. Having no problems with SelectCommand. I don't know how to construct the UpdateCommand and InsertCommand.

Let's say the user changes the date, then I need to do an UPDATE.

UPDATE Trans SET Date = @Date, CustomerID = @CustomerID results in an error message and the record is not updated.

I get an error on the page that says "Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in correct format".


I tried taking out the set for CustomerID and I still get the error on page.


Also, for inserting, the users will see a dropdownlist with Customer Names. I need to convert that to a CustomerID to be used in the new record being inserted in the database. I'm not sure how to do this.


Do I need to do something with Control Parameters?

video tutorial link for composite and rendered custom server control


hii all

i am new to technology so go easy on this post

according to what i read from web there are 3 type of custom server controls

1 superclass

2 composite

3 rendered

i found video tutorial for superclass custom server control but couldnt find video tutials for other 2.

please forward me link for composite and rendered custom server controls video tutorial  

Html Link Button


Hi All,

I would like to create a html link button(in aspx page) so that the page could not post back and some controls to display on clicking link button.

Can any one of you help me regarding this issue?

Let me know if you have any queries.



Data Points: Creating Audit Tables, Invoking COM Objects, and More


Dealing with error handling between T-SQL and a calling application, evaluating when a field's value has changed, and creating auditing tables in SQL ServerT are all common issues that developers must tackle.

John Papa

MSDN Magazine April 2004

The XML Files: XSLT Keys, Select vs. Match, Conflict Resolution, and More


This month Aaron Skonnard covers how keys work in XSLT, XSLT match and select attributes, SelectNodes order, finding