Questions tagged [.net-2.0]

The 2.0 version of the .NET Framework. For questions on .NET Framework generally, use the .net tag.

The 2.0 version of the .NET Framework.

What's New in the .NET Framework 2.0
.NET Framework 2.0 System Requirements

Released by Microsoft Corporation
Version Number: 2.0.50727.42
Release Date: 2005-11-07

2578 questions
32
votes
3 answers

what's the use of string.Clone()?

there are 2 examples of code: # 1 string str1 = "hello"; string str2 = str1; //reference to the same string str1 = "bye"; //new string created and # 2 string str3 = "hello"; string str4 = (string)str3.Clone();//reference to the same…
Arseny
  • 7,251
  • 4
  • 37
  • 52
31
votes
8 answers

What are alternative ways to suspend and resume a thread?

The two methods Thread.Suspend() and Thread.Resume() are obsolete since .NET 2.0. Why? What are other alternatives and any examples?
David.Chu.ca
  • 37,408
  • 63
  • 148
  • 190
30
votes
3 answers

How to migrate a .NET Windows Service application to Linux using mono?

What would be the best approach to migrate a .NET Windows Service to Linux using mono? I've been trying to avoid executing the application as a scheduled command. Is it possible to obtain a service/system daemon(in linux) like behavior?
Raúl Roa
  • 12,061
  • 13
  • 49
  • 64
30
votes
5 answers

Best way to Bulk Insert from a C# DataTable

I have a DataTable that I want to push to the DB. I want to be able to say like myDataTable.update(); But after reading the MSDN docs, apparently this does inserts row by row. It should be noted that these statements are not performed as a batch…
Joda Maki
  • 5,649
  • 6
  • 27
  • 36
30
votes
4 answers

Using DateTime in a SqlParameter for Stored Procedure, format error

I'm trying to call a stored procedure (on a SQL 2005 server) from C#, .NET 2.0 using DateTime as a value to a SqlParameter. The SQL type in the stored procedure is 'datetime'. Executing the sproc from SQL Management Studio works fine. But…
Matt
  • 41,216
  • 30
  • 109
  • 147
30
votes
7 answers

Can I use a .NET 4.0 library in a .NET 2.0 application?

I'm running into some problems using my .NET 4.0 libraries in .NET 2.0 applications. I guess I was under the impression that being a Windows DLL, my other .NET apps would be able to access it. Is this not the case? Any recommendations in terms of…
Douglas Anderson
  • 4,652
  • 10
  • 40
  • 49
30
votes
2 answers

Error : The Out Parameter must be assigned before control leaves the current method

While sending back parameters getting this error Error : The Out Parameter must be assigned before control leaves the current method Code is public void GetPapers(string web, out int Id1, out int Id2) { SqlConnection conn = new…
fdgfdgs dfg
  • 669
  • 4
  • 12
  • 22
29
votes
9 answers

.net construct for while loop with timeout

I commonly employ a while loop that continues to try some operation until either the operation succeeds or a timeout has elapsed: bool success = false int elapsed = 0 while( ( !success ) && ( elapsed < 10000 ) ) { Thread.sleep( 1000 ); …
Suraj
  • 35,905
  • 47
  • 139
  • 250
29
votes
5 answers

Are event subscribers called in order of subscription?

Is it safe to assume that event subscribers are called in order of subscription? Example: void One(object sender, EventArgs e) {} void Two(object sender, EventArgs e) {} event EventHandler foo; foo += One; foo += Two; Is One() always called…
EricSchaefer
  • 25,272
  • 21
  • 67
  • 103
29
votes
4 answers

Override Property with different compatible Type

I need a base class with a property where I can derive classes with the same property but different (compatible) types. The base Class can be abstract. public class Base { public virtual object prop { get; set; } } public class StrBase :…
RainerM
  • 695
  • 3
  • 7
  • 10
29
votes
4 answers

What's the most efficient way to combine two List(Of String)?

Let's say I've got: Dim los1 as New List(Of String) los1.Add("Some value") Dim los2 as New List(Of String) los2.Add("More values") What would be the most efficient way to combine the two into a single List(Of String)? Edit: While I love the…
Jason Towne
  • 8,014
  • 5
  • 54
  • 69
29
votes
4 answers

System.Web.Caching vs. Enterprise Library Caching Block

For a .NET component that will be used in both web applications and rich client applications, there seem to be two obvious options for caching: System.Web.Caching or the Ent. Lib. Caching Block. What do you use? Why? System.Web.Caching Is this…
ESV
  • 7,620
  • 4
  • 39
  • 29
29
votes
5 answers

Loading plug-in DLL files, "The invoked member is not supported in a dynamic assembly."

We have custom DLL's that are not included in our initial setup file. They are loaded at runtime. This process worked fine while using .NET 2.0, but we are getting the "The invoked member is not supported in a dynamic assembly" error message now…
Trevorm
  • 505
  • 1
  • 5
  • 9
28
votes
3 answers

UAC need for console application

I have a console application that require to use some code that need administrator level. I have read that I need to add a Manifest file myprogram.exe.manifest that look like that :
Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
28
votes
10 answers

Best TinyMce editor Image Manager / File upload for Asp.net Mvc

What is the best Image Manager to integrate in TinyMce editor apart the official Moxiecode commercial ones? I'm looking to integrate a light texteditor in an asp.net mvc application and I choosed the Tinymce solution (and not the classic FCKEditor…
Ronnie
  • 4,959
  • 10
  • 51
  • 69