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

推荐订阅源

WordPress大学
WordPress大学
G
Google Developers Blog
M
MIT News - Artificial intelligence
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Fortinet All Blogs
L
LangChain Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
B
Blog
J
Java Code Geeks
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

博客园 - 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