Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Change the output format of the var variabale

$
0
0

I have a method to check the duplicate in the column of a DataTable.

public void ChkDuplicacy(DataTable dt)
{
	try
	{
		var dup_result =
			from c in dt.AsEnumerable()group c by new
			{
			RowId = c.Field("SYMBOL_NO")}
				into g
				where g.Count() > 1
				select new
				{
				    g.Key.RowId
				};
		if (dup_result.ToList().Count > 0)
		{
			for (int i = 0; i < dup_result.ToList().Count; i++)
			{
				var item = dup_result.ToList()[i];
			}
		}
	}
	catch (Exception)
	{
		throw;
	}
}

When I debug this code, for the code block the varibale var item is having values as </div> <div>

RowId = "12345"
RowId = "75395"

I want to extract only the right side values i.e., 12345, 75395 as a List. How can I do that ? Also I have to return this List. How can I do this? Please help!!!


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>