MSDN survey sample problem - column named 'Answer' already belongs to this D

MSDN survey sample problem - column named 'Answer' already belongs to this D

Post by Kevin Smit » Thu, 16 Jan 2003 23:45:06



Found more details.  IIS was set to use v1.1 of .net
for .aspx handling.   When I changed IIS to use v1.0
of .NET for .aspx processing the error does not occur.  

Seems the sample does not act the same under v1.1 of .NET
as under v1.0.

I was hoping to run it under v1.1.  Any ideas?

-Kevin

 
 
 

MSDN survey sample problem - column named 'Answer' already belongs to this D

Post by Mike Moore [MS » Sat, 18 Jan 2003 06:44:37


Hi Kevin,

I noticed that your question has not received a reply. Then I noticed it's
a beta question (not supported).
You might try this other newsgroup: Microsoft.public.dotnet.framework.sdk
I've seen modest volumes of beta questions there and some are receiving
replies.

Good luck with your question.

Thank you, Mike Moore
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.

--------------------

>Content-Class: urn:content-classes:message


>Subject: RE: MSDN survey sample problem - column named 'Answer' already
belongs to this D
>Date: Wed, 15 Jan 2003 06:45:06 -0800
>Lines: 10

>MIME-Version: 1.0
>Content-Type: text/plain;
>    charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcK8pLGbhYUEBlydSsieSUmGHwch0g==
>Newsgroups: microsoft.public.dotnet.distributed_apps
>Path: cpmsftngxa06
>Xref: cpmsftngxa06 microsoft.public.dotnet.distributed_apps:3886
>NNTP-Posting-Host: TK2MSFTNGXA03 10.40.1.48
>X-Tomcat-NG: microsoft.public.dotnet.distributed_apps

>Found more details.  IIS was set to use v1.1 of .net
>for .aspx handling.   When I changed IIS to use v1.0
>of .NET for .aspx processing the error does not occur.  

>Seems the sample does not act the same under v1.1 of .NET
>as under v1.0.

>I was hoping to run it under v1.1.  Any ideas?

>-Kevin


 
 
 

1. MSDN survey sample problem - column named 'Answer' already belongs to this DataT

When I run the Survey sample app I get the error "Error:  
A column named 'Answer' already belongs to this
DataTable".  An exception is thrown from Sub
AdjustQuestionPrimaryKey() in SurveyDataSet.vb. Any ideas?

--------------------------------------------------------
ERROR
--------------------------------------------------------
Could not initialize DataSets.  Error:  A column
named 'Answer' already belongs to this DataTable: cannot
set a nested table name to the same name.
Stacktrace:    at
System.Data.DataColumnCollection.RegisterName(String name,
Object obj)
   at System.Data.DataRelation.set_Nested(Boolean value)
   at
MSDN.Sample.Survey.BusinessRules.SurveyDataSet.AdjustQuesti
onPrimaryKey() in C:\Program Files\Microsoft\MSDN
Survey\Code\BusinessRules\SurveyDataSet.vb:line 42
   at MSDN.Sample.Survey.BusinessRules.SurveyDataSet..ctor
() in C:\Program Files\Microsoft\MSDN
Survey\Code\BusinessRules\SurveyDataSet.vb:line 14
   at
MSDN.Sample.Survey.BusinessFacade.SurveyService.GetSurveyAs
DataSet(Guid surveyId) in C:\Program Files\Microsoft\MSDN
Survey\code\BusinessFacade\SurveyService.asmx.vb:line 73
   at
MSDN.Web.UI.WebControls.Survey.SurveyControl.InitializeData
Set() in C:\Program Files\Microsoft\MSDN
Survey\Code\MSDN.Web.UI.WebControls.Survey\SurveyControl.vb
:line 255

-------------------------------------------------------
CODE THROWING ERROR
-------------------------------------------------------
    Public Sub AdjustQuestionPrimaryKey()

        Answer.Constraints.Remove("Question_Answer")
        Question.Constraints.Clear()

        Question.PrimaryKey = New DataColumn()
{Question.Columns("Id")}

        Dim fkc As ForeignKeyConstraint
        fkc = New ForeignKeyConstraint("Question_Answer",
New DataColumn() {Question.Columns("Id")}, New DataColumn
() {Answer.Columns("Question_Id")})
        fkc.AcceptRejectRule = AcceptRejectRule.None
        fkc.DeleteRule = Rule.Cascade
        fkc.UpdateRule = Rule.Cascade
        Answer.Constraints.Add(fkc)

        Relations.Remove("Question_Answer")
        Dim rel As DataRelation = New DataRelation
("Question_Answer", New DataColumn() {Question.Columns
("Id")}, New DataColumn() {Answer.Columns("Question_Id")},
False)
        rel.Nested = True  <<<<<<<<<<< There she blows!
        Relations.Add(rel)
    End Sub

2. RIS Problem

3. Column name 'Translate' causes 'Unspecified Error' when updating.

4. Help! selecting a Test Tool

5. Can't 'Run Sample' QuickStart Tutorials via samples.gotdotnet.com...

6. "not made by QLogic NOR SUPPORTED BY SGI."

7. "Invalid column name 'ProductID'."

8. -----> How to put my signature in my mail <------

9. ADO error: Invalid Column Name '|'

10. Invalid column name 'Parameter' error

11. MSDN Survey Sample

12. Problem: Column 'XXX' is constrained to be unique, Value 'X' is already present.

13. HOWTO: change the default destination folder for sample app's in VS6.0 MSDN Lib ?