Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 25th, 2004, 05:26 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default removing table from dataset

Hi i am working in asp.net

in my dataset i am using Parent,ChildTables.Like below i am maintaing the relation between 2 tables.

OleDbDataAdapter2.Fill(Dataset21, ChildTable)
OleDbDataAdapter1.Fill(Dataset21, ParentTable)

 If (Dataset21.Relations.Count < 1) Then
            relApserverIntalledApp = New DataRelation("Relat1", Dataset21.Tables(ParentTable).Columns("id"), Dataset21.Tables(ChildTable).Columns("Serverid"))
            Dataset21.Relations.Add(relApserverIntalledApp)
 End If


In one case i want to delete the parenttable from my dataset and want to add it again.
i am doing like below
sbSQl.Append(" select * from Parenttable wehere ....")

Me.OleDbSelectCommand1.CommandText = sbSQl.ToString
Me.OleDbDataAdapter1.Fill(Dataset21.Tables(ParentT able)))
Session.Add("TempTable", Dataset21.Tables(ParentTable)))


then here i am adding the session temptable to dataset21 and want to delete the parent table from dataset
when i try to delete the table from data set like below


Dataset21.Tables.Remove(ParentTable)(here i tried first remove from childtable then parent still same below error)
But it saying
Cannot remove table parenttable, because it referenced in ForeignKeyConstraint xxx. Remove the constraint first.


when i try to remove the constraint its giving can't remove Constraint because its primay key ...

so how to delete the table from my dataset21??








Similar Threads
Thread Thread Starter Forum Replies Last Post
removing unwanted space below table ngvietanh HTML Code Clinic 1 August 24th, 2006 10:28 AM
Creating a new table from a dataset... vb_developer SQL Server ASP 4 September 21st, 2004 07:41 AM
Using Temp Table and dataset Bhavin Crystal Reports 0 September 14th, 2004 08:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.