public int CheckTable(string TableName)
{
int i = 0;
string cmdText = @"IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME='" + TableName + "') SELECT 1 ELSE SELECT 0";
i = (int)ExecuteScalar(cmdText,CommandType.Text,null,null);
return i;
}
{
int i = 0;
string cmdText = @"IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME='" + TableName + "') SELECT 1 ELSE SELECT 0";
i = (int)ExecuteScalar(cmdText,CommandType.Text,null,null);
return i;
}
No comments:
Post a Comment