I am trying to fetch a column value and convert it as a list of formatted string value and iI tried the below code
List<string> _names = (from p in context.RakHolders select select string.Format("{0},{1}", p.Name.Split(',')[0].Trim(), p.Name.Split(',')[1].Trim() )) .ToList(); My intention is to get a list of names with no unwanted space between commas in the column Name
I am getting exception while executing this line as
An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll but was not handled in user code Additional information: LINQ to Entities does not recognize the method 'System.String Format(System.String, System.Object, System.Object)' method, and this method cannot be translated into a store expression. An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll but was not handled in user code
Additional information: LINQ to Entities does not recognize the method
'System.String Format(System.String, System.Object, System.Object)' method, and this method cannot be translated into a store expression.
How can iI make this workingwork [get a list of formatted column values ]withvalues] with LINQ