.net

How can I correct the error "accessed from a thread other than the thread it was created on"?

This following code gives me the error below . I think I need "InvokeRequired" . But I don't understand how can I use? Cross-thread operation not valid: Control 'listBox1' accessed from a thread other than the thread it was created on. The code: using System.Collections.Generic; using System.ComponentModel; using System.Data; usin...

Using Unity Application Block in commercial programm (Ms-PL)

Hello, i´have read the Ms-PL under the Homepage of Unity, but its not clear for me what i need to do, when i use Unity in my commercial programm? I only use the binary files and i want to distribute them along with my programm. Do i have to provide a license-file anywhere? Do i have to tell anywhere in my programm that i´m using Unit...

Is there an example of the Builder Pattern in the .NET BCL?

Is there an example of the full builder pattern in the .NET base class library? I'm looking for something that has an actual director and multiple concrete builders. ...

Windows Update API c# code can't get update history

I'm writing a code to automatically patch Windows Operation Systems with security hotfixes in a corporate intranet. (I'm using Visual Studio .NET, thus .NET framework 1.1, and developing in c#.) As a first step, I'd like to list the hotfixes already applied to the system using the WUApi. I've added the reference to the "tlbimped" wuapi.d...

How to format text to ######.##

Hi how to limit text to 6 numbers . 2 numbers ? (######.##) thank's in advance ...

printing to pdf

The existing system has many reports . Using a free pdf printer like dopdf or cutepdf the user can open the report , choose the pdf printer , type in the filename and save the report as a pdf file.This seems a bit tedious It would be nice to have the report directly saved as a pdf file just on click of a button. Unfortunately the report...

problem with NetServerEnum() in c#

I am developing an application which requires to list all the current LAN machines. Inorder to list all the workstations on a LAN, i have used NetServerEnum() after importing it. On running the program, it seemed to work fine. The two existing machines were detected correctly. However, i want the list to be refreshed whenever required ...

What is the best way to Version an ASP.NET 2.0 Web Service?

I am maintaining a SOAP web service (ASP.NET version 2.0) and I have to make some changes that will modify the return values of particular methods. What is the generally accepted method of doing this without breaking existing implementations. My initial thoughts are that the following would all be possible. a) Provide new version sp...

How do you sort an EntitySet<T>

The MSDN documentation states that an EntitySet implements IBindingList (see 'Binding to EntitySets' at http://msdn.microsoft.com/en-us/library/bb546190.aspx) However, it can be clearly seen that an EntitySet does not implement this interface! So how do I sort? For context, I'm binding this set to a WPF ListView. For wider context o...

Querying multiple databases on SQL Server

Hi is it possible to create a view that selects from multiple tables in different databases on different servers using different login credentials Can someone point to any online examples. Or is there any way I can do it using Linq if I cant create a view ...

Windows control returns different values when accessed different ways

I have a control, hosted on DesignSurface. When its Location property is accessed by control.Location, and when it's accessed by propertyDescriptor.GetValue(control), I get different values. propertyDescriptor is of type PropertyDescriptor. Does anyone have a solution to this? I have checked that the object instance is the same. ...

How to find foreign key dependencies in SQL Server?

How can I find all of the foreign key dependencies on a particular column? What are the different alternatives (graphically in SSMS, queries/views in SQL Server, 3rd party database tools, code in .NET)? ...

Resources distribution to IIS processes and standard windows applications

We have a server machine with very good configuration on our LAN 4 GB of RAM 1 TB HDD Quad Processor We can have 2 types of application running on the server ASP.NET web application running under the IIS supervision Standard windows application running with administraive account. My question is how the resources are distributed b...

Declaring web controls in code behind or just in aspx

In .net 1.1 I seem to remember I had to declare web controls that I had put on my aspx page also in the code behind in order to access them programatically. Since working in VS 2008 I haven't had to do that - even when working with .net 2 projects. But I just imported a 1.1 project and converted it in 2008 and added a textbox with an i...

Is it possible to attach a .NET System.Diagnostics.Process object to a running process?

Suppose I wish to examine a currently executing process via the properties of the System.Diagnostics.Process class. Is it possible to load an instance of this class with that process (i.e., somehow attach a Process object to the process), or does one have to have started it with the Start method? ...

Obfuscation in .NET: how is it done how secure is it?

I brought up a point about obfuscation in another question to which someone replied "obfuscation doesn't stop much". Rather than start a debate in comments on there, I wanted serious community answers as to how safe my code is when obfuscated with X, Y or Z obfuscator, and if any obfuscation tools truly get the job done. I'm also inter...

Is there an microsoft/.net "version" of the Google visualization api

Hi, This is just an open question on whether similar type tools/services for visualization available in .Net. Thanks. ...

Application Logs in Win Form Application

What is an application log? How is it different from Error Log? What kind of information should Application log file contain. Are there any built in classes which I can use for that? ...

How does SqlCommand (.NET) sanitize parameters?

Using SqlParameters is a recommended method to prevent SQL Injection in your database queries. Where can I find the code/function that internally sanitizes these parameters? I'd like to re-use this function in a custom implementation of mine. I tried to find it using Reflector, but was unsuccessful. ...

T-SQL Management Studio Execute SP Execution Plan - Is there a 'Max Number of Result Sets'

Hey Now, Is there a 'Max # of result sets that can be displayed' when executing a stored procedure & including the actual execution plan (Ctrl+M)? The query has exceeded the maximum number of result sets that can be displayed in the Execution Plan pane. Only the first 250 result sets are displayed in the Execution Plan pane. Thx, ...