This is my read:
OnSiteV3DataContext _v3Context = new OnSiteV3DataContext();
var dataset1 = (from sp in _v3Context.SQLPendingEvents
where
(sp.EventType.ToString() == str100w)
select new
{
sp.KeyDeviceID,
sp.UpdateTime ,
sp.EventClass ,
sp.EventCode ,
sp.EventType ,
sp.EventDateTime ,
sp.KeyPropertyID,
sp.KeyEntityID,
sp.EventText,
sp.KeyUserID,
sp.EventImage,
sp.TaskType ,
sp.TaskSubType ,
sp.UniqueTaskID
}).ToList();
dataset1 = dataset1.Where(sp => !sp.KeyDeviceID.ToString().Contains('~')).ToList();
gvSqlPendingEvent.DataSource = dataset1;
gvSqlPendingEvent.DataBind();
Ther dataset has no unique identifier to identify individual records, so I would like to add one. I want the first column to be this identifier - it could be based on the rowcount. How can I achieve this?