Hi ramco1917,
Please refer below sample.
HTML
<asp:GridView ID="gvDetails" runat="server" />
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
TestEntities db = new TestEntities();
List<Product> products = (from p in db.CommaSeperatedDatas
where p.ProductName.Contains(",")
select new Product
{
Id = p.ID,
ProductType = p.ProductType,
ProductName = p.ProductName
}).ToList();
gvDetails.DataSource = products;
gvDetails.DataBind();
}
}
public class Product
{
public int Id { get; set; }
public string ProductType { get; set; }
public string ProductName { get; set; }
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim db As TestEntities = New TestEntities()
Dim products As List(Of Product) = (From p In db.CommaSeperatedDatas Where p.ProductName.Contains(",") Select New Product With {
.Id = p.ID,
.ProductType = p.ProductType,
.ProductName = p.ProductName
}).ToList()
gvDetails.DataSource = products
gvDetails.DataBind()
End If
End Sub
Public Class Product
Public Property Id As Integer
Public Property ProductType As String
Public Property ProductName As String
End Class
Screenshot