Browsing 7239 questions and answers with Jon Skeet
This is because XmlAttributeCollection only implements IEnumerable rather than IEnumerable<T>. You can just change your query expression to: var enumAttr = from XmlAttribute attr in element.Attributes select attr; which is... more 1/17/2014 10:50:05 AM
Each method invocation will have a separate set of local variables. However, those variables could refer to objects which other methods also use. For example: public void AppendSomething(StringBuilder builder) { ... more 1/17/2014 10:28:04 AM
"I get an error" is fairly vague - you would get a NullReferenceException if you used item.Description.Equals("euro")) but this should be fine: if (item.Description == "euro") { tbItemInput.Rows.Add(tbRow4); ... more 1/17/2014 10:20:33 AM
Look at how you're encoding the text to send it: byte[] byData = System.Text.Encoding.UTF32.GetBytes(subtext); Now look at how you're decoding the binary data back into text: System.Text.Decoder d =... more 1/17/2014 9:49:58 AM
No, local variables are purely local to the method in question. It's not really clear what you're trying to achieve, but if you want any state which persists between method calls, you'll need a field, and probably expose it as a... more 1/17/2014 9:38:07 AM
Well one starting point would be to create a Dictionary<string, XElement> mapping the row ID to the element: var dictionary = doc.Element("AA").Element("BB").Element("CC").Elements("myNode") .ToDictionary(x =>... more 1/17/2014 9:27:40 AM
Your question is unclear ("since web project is already refereed into the webproject" for example) but you should really make the web project have a reference to the core project, but not the other way round. The core business logic... more 1/17/2014 8:17:29 AM
No, every version of .NET has been standalone. You can install .NET 3.0 with no other version installed, ditto .NET 3.5, ditto 4.0, ditto 4.5 etc. Now there have been fewer versions of the CLR than there have of the .NET framework... more 1/17/2014 7:02:31 AM
As you say, Date1 is of the form MM/dd/yyyy... but you're trying to parse it with a format of yyyy-MM-dd HH:mm:ss. The pattern you parse to the SimpleDateFormat constructor has to match the format of the data itself. (What did you think... more 1/16/2014 11:36:11 PM
From the docs for JList.getSelectedValue() (emphasis mine): Returns the value for the smallest selected cell index; the selected value when only a single item is selected in the list. When multiple items are selected, it is simply the... more 1/16/2014 11:12:54 PM