By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

smo and check constraints

P: n/a
How do you connect the check constraints on the Table object with the
columns in the table?

I ended up doing this and it smells bad.

foreach (Column cn in t.Columns)
{
foreach (Check ch in t.Checks)
{
if (ch.Text.Contains(cn.Name))
{
ct = typeof(bool);
break;
}
}
}

I couldn't find a Checks collection on the column or any other property
that might have show any check constraints.

Is there a better way for this?
Oct 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
foreach (Constraint ch in t.Constraints)
{
if (ch.ConstraintName.Contains(cn.ColumnName))
{
ct = typeof(bool);
break;
}
}
use this ur problem is not clear

"Dan Holmes" wrote:
How do you connect the check constraints on the Table object with the
columns in the table?

I ended up doing this and it smells bad.

foreach (Column cn in t.Columns)
{
foreach (Check ch in t.Checks)
{
if (ch.Text.Contains(cn.Name))
{
ct = typeof(bool);
break;
}
}
}

I couldn't find a Checks collection on the column or any other property
that might have show any check constraints.

Is there a better way for this?
Oct 26 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.