惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
月光博客
月光博客
B
Blog RSS Feed
C
Check Point Blog
WordPress大学
WordPress大学
T
Tailwind CSS Blog
GbyAI
GbyAI
H
Help Net Security
Y
Y Combinator Blog
I
InfoQ
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
美团技术团队
博客园 - 三生石上(FineUI控件)
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
A
About on SuperTechFans
G
Google Developers Blog
爱范儿
爱范儿
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
人人都是产品经理
人人都是产品经理

博客园 - upzone

FTP Handler cannot be hosted in x64 Host instance Next Release of BizTalk Server: BizTalk Server 2010 R2 Passed MS BI Certification: 70-448 Passed new BizTalk Certification: 70-595 FW: BizTalk's furture OLAP Architectures Comparison (ROLAP, MOLAP, HOLAP) 远程桌面访问Matlab的方法 FW: BIZTALK: Cannot perform encryption or decryption because the secret is not available from the master secret server 401 Unauthorized when call WCF in BizTalk,The authentication header received from the server was 'Negotiate,NTLM' - upzone Matlab first Prog. Visual Studio 2008: Install New Project Template SQL Server 兼容模式 FW: HTTP错误500显示具体的出错信息的方法 XmlSerialize error: There was an error generating the XML document. 装了Visual Studio 2010 后 Enterprise Single Sign-On 无法启动. Javascript 实现延迟跳转 - upzone - 博客园 六一,外公走了 FW: MOSS SSP Failed to provision - No running instances of Shared Services Provider provisioning TFS Build Notification: TFS 30063, you are not authorized to access the tfs
Issue when try to get select count using Linq to SQL
upzone · 2010-06-21 · via 博客园 - upzone

Issue:

DataBase sp:

select count(*) from training where domain = @domain and username = @username

Linq: TrainingDatabase.dbml

Main Class:

TrainingDataBaseDataContext context = new TrainingDataBaseDataContext("Data Source=.;Initial Catalog=Training;Integrated Security=True");
var results = context.spGetUserCompletion("psdcrm", "administrator");
foreach (var result in results)
{
      if (result.Column1.HasValue && result.Column1.Value > 0)
      {
            Console.WriteLine("TRUE");
      }
}

I except to get one line "true", but failed.

Cause:

Maybe Linq cannot map computed column to the Column1 entity.

Solution:

try to modify the sp and add the alias column name just like below:

select count(*) as Column1 from training where domain = @domain and username = @username