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

5938 questions
1140
votes
22 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
  • 25,619
  • 25
  • 85
  • 120
1087
votes
19 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
  • 97,670
  • 29
  • 122
  • 130
712
votes
11 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
  • 12,481
  • 7
  • 30
  • 32
709
votes
11 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
  • 84,693
  • 113
  • 396
  • 647
667
votes
12 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
  • 49,102
  • 20
  • 108
  • 119
493
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,950
  • 9
  • 32
  • 39
474
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
439
votes
16 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
  • 12,312
  • 20
  • 59
  • 78
411
votes
3 answers

.NET 3.5 JIT not working when running the application

The following code gives different output when running the release inside Visual Studio, and running the release outside Visual Studio. I'm using Visual Studio 2008 and targeting .NET 3.5. I've also tried .NET 3.5 SP1. When running outside Visual…
Philip Welch
  • 4,488
  • 2
  • 20
  • 17
389
votes
35 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
  • 17,121
  • 25
  • 77
  • 111
350
votes
22 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
  • 33,720
  • 26
  • 113
  • 165
328
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
  • 39,309
  • 62
  • 192
  • 278
277
votes
17 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 - MSFT
  • 21,454
  • 43
  • 116
  • 176
256
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
  • 8,149
  • 8
  • 44
  • 71
217
votes
10 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,514
  • 4
  • 27
  • 32
1
2 3
99 100