473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Tables.CanRemove

I'm doing this:

if ((this.Tables.Contains(dt.TableName)) & (this.Tables.CanRemove(dt)))
{
this.Tables.Remove(dt);
}

and my table is not being removed. Which is fine, I guess. The things
is, I don't know why.

I have confirmed that it is the second portion of the boolean that's
saying no to my request (and, yes, the first portion is returning true).

So what are the possible reasons for CanRemove returning false? By what
criteria does its algorithm evaluate the question?
Nov 28 '05 #1
4 1227
C Glenn,

It's possible that there are constraints on a column which depend on a
column in the table you are trying to remove. You would have to remove
these constraints first, and then you could remove the table.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"C Glenn" <no****@domain.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm doing this:

if ((this.Tables.Contains(dt.TableName)) & (this.Tables.CanRemove(dt)))
{
this.Tables.Remove(dt);
}

and my table is not being removed. Which is fine, I guess. The things
is, I don't know why.

I have confirmed that it is the second portion of the boolean that's
saying no to my request (and, yes, the first portion is returning true).

So what are the possible reasons for CanRemove returning false? By what
criteria does its algorithm evaluate the question?

Nov 28 '05 #2
Just to make sure - you did actually use '&&' and not '&' in your code
right?
if ((this.Tables.Contains(dt.TableName)) & (this.Tables.CanRemove(dt)))
{
this.Tables.Remove(dt);
}
--
Adam Clauss

"C Glenn" <no****@domain.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... I'm doing this:

if ((this.Tables.Contains(dt.TableName)) & (this.Tables.CanRemove(dt)))
{
this.Tables.Remove(dt);
}

and my table is not being removed. Which is fine, I guess. The things
is, I don't know why.

I have confirmed that it is the second portion of the boolean that's
saying no to my request (and, yes, the first portion is returning true).

So what are the possible reasons for CanRemove returning false? By what
criteria does its algorithm evaluate the question?

Nov 28 '05 #3
No! I used '&'. Thanks for the tip. I looked up '&&' and will use it
in situations like this in future.

Adam Clauss wrote:
Just to make sure - you did actually use '&&' and not '&' in your code
right?

if ((this.Tables.Contains(dt.TableName)) & (this.Tables.CanRemove(dt)))
{
this.Tables.Remove(dt);
}


Nov 28 '05 #4
Absolutely no constraints of any kind.
Nicholas Paldino [.NET/C# MVP] wrote:
C Glenn,

It's possible that there are constraints on a column which depend on a
column in the table you are trying to remove. You would have to remove
these constraints first, and then you could remove the table.

Hope this helps.

Nov 28 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
59
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.