正常情况下,在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 

相关文章:

  • 2021-07-06
  • 2022-12-23
  • 2021-07-30
  • 2022-03-08
  • 2022-12-23
  • 2022-01-24
  • 2021-09-14
猜你喜欢
  • 2022-12-23
  • 2022-01-30
  • 2022-02-27
  • 2021-07-25
  • 2021-07-13
相关资源
相似解决方案