Convert int to string in LINQ to Entities Query


/ Published in: C#
Save to your folder(s)

For some reason, methods in this class can actually be called to manipulate data in EF queries.


Copy this code and paste it in your HTML
  1. ddEnrollmentMethod.DataSource = from t in context.EnrollmentMethods
  2. orderby t.Name
  3. select new
  4. {
  5. Name = SqlFunctions.StringConvert((double)t.EnrollmentMethodID) + ". " + t.Name,
  6. t.EnrollmentMethodID
  7. };

URL: http://msdn.microsoft.com/en-us/library/system.data.objects.sqlclient.sqlfunctions.aspx

Report this snippet


Comments


You need to login to view comments.