linq to sql 中isnumeric的使用

正常情况下,在linq to sql 中是不能使用isnumeric函数的,但是在我们的DBML(linq to sql )文件中,用XML的格式打开此文件,在'</Database>' 的前面添加下面这行代码:<Function Name="ISNUMERIC" IsComposable="true">      <Parameter Name="Expression" Parameter="Expression" Type="System.String" DbType="NVarChar(4000)" />      <Return Type="System.Boolean" DbType="BIT NOT NULL"/>  </Function>  在linq to sql 语句中便可使用isnumeric函数了。如下所示:

var blah = myDataContext.Accounts.Where(account=> myDataContext.ISNUMERIC(account.ID) == true); 

原文章在:http://stackoverflow.com/questions/558054/how-to-know-if-a-field-is-numeric-in-linq-to-sql 

原文地址:https://www.cnblogs.com/xingqiba/p/2486889.html