如何在linq数据源中插入空记录? [英] How to insert empty record in linq DataSource?

查看:90
本文介绍了如何在linq数据源中插入空记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在数据库(SQL)中有一个表"Information",它具有3个字段:ID,Date,Description
我想在date1和date2之间的gridview中显示此数据,但是如果date3在date1和date2之间,但是我想显示date3的空记录,但是我的表中没有Date = date3的数据,我该如何处理C#和Linq?

Hello, I have a table "Information" in my dataBase(SQL), it has 3 fields : ID , Date , Description
I want to show this data in a gridview between date1 and date2, but I want to show an empty record for date3 if date3 is between date1 and date2 but there is no data in my table that Date = date3, how can i do this with C# and Linq?

推荐答案

问题不是很清楚,但是我已经从中优化了一些东西,

我的问题是,为什么在地球上您想使用C#和Linq来完成任务,而不是直接应用Sql Query,

有关更多信息,请参见文章.
http://www.plus2net.com/sql_tutorial/between-date.ph [ ^ ]

如果有帮助,请 投票 接受答案 .
The question is not so clear but I have optimized some thing from that,

My question is that why on the earth you want to accomplish the things using C# and Linq rather then applying Sql Query directly,

See the article for more info.
http://www.plus2net.com/sql_tutorial/between-date.ph[^]

Please vote and Accept Answer if it Helped.


这篇关于如何在linq数据源中插入空记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆