[英]How do I get parts of Blacklist checked
if (!blacklist.Contains(tabName) && (allowedSchemas.Contains(schName)) )
{
string schemaname = GetStringFromReader(reader, "SchemaName");
string tablename = GetStringFromReader(reader, "TableName");
string description = GetStringFromReader(reader, "Description");
string columnname = "null";
tabInfo.Add(new TableInfo(schemaname, tablename, columnname, description));
}
this is my Code i have a Problem. 这是我的代码我有问题。 For example i have tabName= BSPname and in my Blacklist= BSP.
例如,我有tabName = BSPname,而在我的Blacklist = BSP中。 So i need to get here a true.
所以我需要在这里得到一个真实的。
Now it gives me only true if Blacklist == tabName. 现在,只有Blacklist == tabName,它才给我真。
So I need sth like in MSSQL: tabName NOT LIKE %@blacklist% 所以我需要像在MSSQL中一样:tabName不喜欢%@ blacklist%
I hope you understand my question 我希望你能理解我的问题
Janik 雅尼克
you need like this tabName NOT LIKE %@blacklist%
than you need to check in string that means you need to apply contains on string as below 您需要这样的
tabName NOT LIKE %@blacklist%
不是需要签入字符串,这意味着您需要在字符串上应用包含,如下所示
var match = blacklist.FirstOrDefault(s=>tabName.ToUpper().Contains(s.ToUpper()));
if( match==null && (allowedSchemas.Contains(schName)) )
{
..your code
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.