Tuesday, 15 June 2010

c# - return string[] from LINQ IQueryable object? -


I'm trying to work with .NET AJAX autocomplete extensions. The extension is expecting the following ...

  public static string [] GetCompletionList (string prefix text, integer number, string reference)  

My Database questions are in a LINQ var object, I am not able to convert type IQueryable into a string about not being able to get compile-time errors. Var assetsInstorage = An asset from a .set where a.Name. Sorted by a compatible (prefixText) one. Name the ascending new [] [a.Manufacturer.Name, a.Name}; Return (string []) assetsInstorage;

before getting the string [] On the query only, select a string property , not an unknown object:

  var assetsInstorage = From the property Asset where a.Name.Contains (prefixText) commands by one. Select the name ascending a.Manufacturer.Name; // or a.Name  

assetsInstorage at this time a IEnumerable & lt; String & gt; , and after that you string [] by:

assets of returnStorage Toure ();

No comments:

Post a Comment