.net-3.5

What version of the .NET framework ahould I target?

I'm a desktop C# developer (that is not ASP) and am wondering about version targeting for small personal projects. These are, of course, trying to reach as wide an audience as possible, and so I've been targeting .NET 3.0 (which is the latest version on a Windows Vista system without any service packs) and 2.0 (which is simply the most ...

How can I reliably check client identity whilst making DCOM calls to a C# .NET 3.5 Server?

I have an old Win32 C++ DCOM Server that I am rewriting to use C# .NET 3.5. The client applications sit on remote Windows XP machines and are also written in C++. These clients must remain unchanged, hence I must implement the interfaces on new .NET objects. This has been done, and is working successfully regarding the implementation of...

I want to display the missing (non-matching) records

Is there a way to program the following SQL query SELECT dbo.Assets_Master.Serial_Number, dbo.Assets_Master.Account_Ident, dbo.Assets_Master.Disposition_Ident FROM dbo.Assets_Master LEFT OUTER JOIN dbo.Assets ON dbo.Assets_Master.Serial_Number = dbo.Assets.Serial_Number WHERE (dbo.Assets.Serial_Num...

WCF with 3.5 and 4.0 together

Has anyone managed to run wcf successfully in 2.0 integrated mode on IIS7 when .net 4 has been installed? I found that installing .net 4 removed the 2.0 handlers for svc and replaced them with .net 4 versions (this led to a 404.17 error in my v3.5 site), I managed to get my 3.5 site working again by running ServiceModelReg.exe /i from ...

Design Pattern for error handling in ASP.NET 3.5 site

I am relatively new to ASP.NET programming, and web programming in general. We have a site we recently ported from .NET 1.1 to 3.5. Currently we have two methods of error handling: either catching the error during data load on a page and displaying the formatted error in a label on the page, or redirecting to a generic error page. Both o...

msbuild for .NET 3.5 issue with csla and System.Linq

This is a weird problem. I am trying to build a .NET 3.5 solution with msbuild. I generally write custom build scripts for this, and when I tried this time to build a simple .NET assembly which internally uses CSLA, it started giving me Linq errors. However, if I build the proj file via msbuild (command line), it seems to build just fi...

How do I find out what process Id and thread id / name has a file open

Hi All, I am using C# in an application and am having some problems with a file becoming locked. The piece of code does this, while (true) { Read a packet from a socket (with data in it to add to the file) Open a file // one of these randomly throws an exception saying that the file is locked Writes data to it Close a file...

.Net - Join together all item of a list in a output string

How can I write a Linq expression (or anything else) that select item from a List and join them together ? Example IList<string> data = new List<string>(); data.Add("MyData1"); data.Add("MyData2"); string result = //some linq query... I try data.Select(x => x + ","); //result = "MyData1, MyData2" ...

How to insert selected rows value of Gridview into Database in .net

I am Developing Windows Form Application in .Net, I want to insert selected rows value of Gridview into database. First Column of my GridView is Checkbox, when user check one or more checkbox from gridview, i want to insert values of respective rows into Database. In Web application i done this using DataKeyNames property of GridView. W...

how to Update the XMl value and write back using LINQ

I have a query about updating a node value using Linq, For example I have to update <Student> <studentdetail> <studentname>test</studentname> <libraryid>hem001</libraryid> </studentdetail> </Student> In the above XML I want to change the value of Student name "test" to something else like "Undertest". ...

File upload progress

I've been trying to track the progress of a file upload but keep on ending up at dead ends (uploading from a C# application not a webpage). I tried using the WebClient as such: class Program { static volatile bool busy = true; static void Main(string[] args) { WebClient client = new WebClient(); // Add some...

Can't set breakpoints on an auto-property setter ? Why?

Apparently VS 2008 does not allow setting a breakpoint just on the setter of an auto-property. I.e. if I define an auto-property like this: public int CurrentFramesize { get; protected set; } and then try to set a breakpoint on the setter line, the whole auto-property turns breakpoint-red. This works j...

.NETCF ShowDialog and RadioButton controls

The scenario... I have two forms, F1 and F2. F1 contains a couple of radio buttons with a single event handler attached to the click event of both. F1 also contains a MainMenu, one option of which opens F2 using ShowDialog(). F2 contains a MainMenu, one option of which sets the DialogResult of F2 to DialogResult.OK, thus closing the di...

Converting between 2.0 3.5; Xp to WS 2003

It works on my desktop but when I transfer to the server: Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the...

C#: How to construct a variable from another variables

How to construct new variable in C#. I mean, to have sth like this public void updateXXX(string endingOfVariable, int newValue) { this.textBox_{endingOfVariable} = newValue; } This is implemented in Php: $a = 'var'; $b = 'iable'; $variable = 'var'; echo ${$a.$b}; But maybe it is possible in C#. The problem is that - I created ...

AppDomain.CurrentDomain.DomainUnload not be raised in Console app

I have an assembly that when accessed spins up a single thread to process items placed on a queue. In that assembly I attach a handler to the DomainUnload event: AppDomain.CurrentDomain.DomainUnload += new EventHandler(CurrentDomain_DomainUnload); That handler joins the thread to the main thread so that all items on the queue can compl...

JIT compiler will come here again ?

Hi All , I have one doubt here , I have one asp.net MVC web application and every night we are recylcing the applciation pool from IIS. Now when the next day first request comes it is taking time to get response. First request it is taking time because app domain is not loaded (application is not started) to start web application it...

C# - ThreadPool.QueueUserWorkItem() Requirements

I have a windows service that has a lot of work to do simultaneously. I've looked into threading and found the ThreadPool class. I'm currently stuck, it doesn't seem to have any effect, it's like whatever I'm queuing is never run or called. In the service's OnStart() event I create a thread like this: Thread mainThread = new Thread(Rece...

Clear text username password authentication in Wcf over https

My question may be very silly but here it is. I went through this question. jassuncao has suggested to use custom binding created Yaron Naveh. Now that it is not a very secure way of authentication, my question is, what if I use Yaron's custom binding and put my service behind https? Will it still be unsecured? ...

Understanding syntax in c#

I am hoping someone can help me understand what is going on in the code line below: Table t = (Table)Page.FindControl("Panel1").FindControl("tbl"); I understand Page.FindControl("Panel1").FindControl("tbl"); Why is there a (Table) before the Page.FindControl? ...