开发者

How to insert empty record in linq DataSource?

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 Dat开发者_JS百科e = date3, how can i do this with C# and Linq?


Here's an example in VB

Dim varListado As List(Of Information) = (From varNNN In varEntidades.Information Where varNNN.ID > 0 Select varNNN).ToList

If addNew = True Then
    Dim varNew As New Information
    varNew.ID = 0
    varNew.Description = "New Record Added"
    varNew.Date = Now
    varListado.Insert(0, varNew)
End If
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜