Questions tagged [.net-3.5]

The 3.5 version of the .NET Framework, which is based on the 2.0 .NET Framework with extra assemblies (including 3.0). Use for questions specifically related to .NET Framework 3.0. For questions on .NET Framework generally, use the .net tag.

The 3.5 version of the Microsoft .NET Framework, which is based on the 2.0 .NET Framework. In addition, it installs .NET Framework 2.0 SP1, (installs .NET Framework 2.0 SP2 with 3.5 SP1) and .NET Framework 3.0 SP1 (installs .NET Framework 3.0 SP2 with 3.5 SP1).

What's New in .NET Framework 3.5
.NET Framework 3.5 System Requirements

Released by Microsoft Corporation
Version Number: 3.5.21022.8
Release Date: 2007-11-19

5917 questions
1246
votes
20 answers

LINQ's Distinct() on a particular property

I am playing with LINQ to learn about it, but I can't figure out how to use Distinct when I do not have a simple list (a simple list of integers is pretty easy to do, this is not the question). What I if want to use Distinct on a list of an Object…
Patrick Desjardins
  • 125,683
  • 80
  • 286
  • 335
1073
votes
23 answers

LINQ query on a DataTable

I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example: var results = from myRow in myDataTable where results.Field("RowNo") == 1 select…
Calanus
  • 23,416
  • 24
  • 77
  • 118
967
votes
16 answers

Creating a byte array from a stream

What is the prefered method for creating a byte array from an input stream? Here is my current solution with .NET 3.5. Stream s; byte[] b; using (BinaryReader br = new BinaryReader(s)) { b = br.ReadBytes((int)s.Length); } Is it still a…
Bob
  • 90,304
  • 29
  • 114
  • 125
627
votes
9 answers

Which method performs better: .Any() vs .Count() > 0?

in the System.Linq namespace, we can now extend our IEnumerable's to have the Any() and Count() extension methods. I was told recently that if i want to check that a collection contains 1 or more items inside it, I should use the .Any() extension…
Pure.Krome
  • 78,923
  • 102
  • 356
  • 586
602
votes
10 answers

Use LINQ to get items in one List<>, that are not in another List<>

I would assume there's a simple LINQ query to do this, I'm just not exactly sure how. Given this piece of code: class Program { static void Main(string[] args) { List peopleList1 = new List(); …
JSprang
  • 11,221
  • 7
  • 27
  • 32
590
votes
11 answers

Concat all strings inside a List using LINQ

Is there any easy LINQ expression to concatenate my entire List collection items to a single string with a delimiter character? What if the collection is of custom objects instead of string? Imagine I need to concatenate on object.Name.
Jobi Joy
  • 45,978
  • 20
  • 106
  • 120
473
votes
13 answers

WCF - How to Increase Message Size Quota

I have a WCF Service which returns 1000 records from database to the client. I have an ASP.NET WCF client (I have added service reference in asp.net web application project to consume WCF). I get the following message when I run the client…
bugBurger
  • 6,722
  • 9
  • 29
  • 39
434
votes
12 answers

What is the difference between IQueryable and IEnumerable?

What is the difference between IQueryable and IEnumerable? See also What's the difference between IQueryable and IEnumerable that overlaps with this question.
Nirmal
403
votes
13 answers

How to bind inverse boolean properties in WPF?

What I have is an object that has an IsReadOnly property. If this property is true, I would like to set the IsEnabled property on a Button, ( for example ), to false. I would like to believe that I can do it as easily as IsEnabled="{Binding…
Russ
  • 11,560
  • 19
  • 55
  • 72
378
votes
34 answers

Could not find default endpoint element

I've added a proxy to a webservice to a VS2008/.NET 3.5 solution. When constructing the client .NET throws this error: Could not find default endpoint element that references contract 'IMySOAPWebService' in the ServiceModel client configuration…
edosoft
  • 16,270
  • 24
  • 75
  • 108
321
votes
21 answers

How to parse a string into a nullable int

I'm wanting to parse a string into a nullable int in C#. ie. I want to get back either the int value of the string or null if it can't be parsed. I was kind of hoping that this would work int? val = stringVal as int?; But that won't work, so the…
Glenn Slaven
  • 31,855
  • 25
  • 107
  • 163
274
votes
4 answers

Generic method with multiple constraints

I have a generic method which has two generic parameters. I tried to compile the code below but it doesn't work. Is it a .NET limitation? Is it possible to have multiple constraints for different parameter? public TResponse Call
Martin
  • 35,202
  • 58
  • 178
  • 268
239
votes
10 answers

Why Response.Redirect causes System.Threading.ThreadAbortException?

When I use Response.Redirect(...) to redirect my form to a new page I get the error: A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll An exception of type…
Ben Hoffman
  • 7,769
  • 6
  • 41
  • 69
232
votes
15 answers

How to read an entire file to a string using C#?

What is the quickest way to read a text file into a string variable? I understand it can be done in several ways, such as read individual bytes and then convert those to string. I was looking for a method with minimal coding.
Shamim Hafiz
  • 19,616
  • 36
  • 104
  • 164
182
votes
7 answers

Creating a DateTime in a specific Time Zone in c#

I'm trying to create a unit test to test the case for when the timezone changes on a machine because it has been incorrectly set and then corrected. In the test I need to be able to create DateTime objects in a none local time zone to ensure that…
Jack Hughes
  • 5,016
  • 4
  • 25
  • 31
1
2 3
99 100