Syntax Help. C# , ASP.net

Pho3nix

The Legend
Joined
Jul 31, 2009
Messages
32,825
Reaction score
3,033
Location
On the toilet
Code:
 var ExternalPackageData = (from Package in externalPackageData where (Package.FieldValues.ElementAt(3).ToString = strGuid)
                                       select new 
                                       {
                                           TaskUID = Package.FieldValues.ElementAt(1).Value.ToString(),
                                           ProjectUID = Package.FieldValues.ElementAt(3).Value.ToString(),
                                           PackageName = Package.FieldValues.ElementAt(4).Value.ToString()
                                       }).ToList();

Keep getting an error on the Where part..assistance?
 
Package.FieldValues.ElementAt(3).ToString()
 
:o Thank you..moomish of note.

How would I handle null values as they crash the application?
 
You'll have to check if values are null and handle that, ie:

if(myItem == null)
// set it to not be null or display warning
 
Code:
var ExternalPackageData = (from Package in externalPackage where(Package.FieldValues.ElementAt(4).Value != null)

Went with this..but soon found out that it really wasn't working because the SQL server had been shutdown for some reason..

Thanks for all the help
 
You should ask these kind of question at StackOverflow, much more answers in a shorter period of time
 
Top
Sign up to the MyBroadband newsletter
X