.net

Stop static constructor

How to stop a static constructor(i.e. module constructor & type constructor) from running in .NET? For example: class A { static A() { Environment.Exit(0); } static int i() { return 100; } } How to invoke i() without exiting? ...

Encoding problems with dBase III .dbf files on different machines

Hello. I'm using C# and .NET 3.5, trying to import some data from old dbf files using ODBC with Microsoft dBase Driver. The dbf's are in dBase III format and using ibm850 encoding for strings. Now, when I run my program on my machine, all string data read from OdbcDataReader comes out converted to UTF-16 or UTF-8 or something, idk a...

.Net samples to receive eBay SOAP notifications

Anybody know of any .Net sample code to receive SOAP notifications from eBay. I can receive the notifications as a POST request and while I could parse out the XML to get what I want I'm hoping there's an easier way to do it by using the classes already defined in the eBay .Net SDK (unfortunately provided without any sample code to recei...

Is knowledge of data structures required for a Sr .net developer?

I was looking at one of the job postings the other day and surprised to see this requirement. "Knowledge of standard data structures ( b-tree, linked list, hash ) and standard algorithms ( sort, merge, b-search ) " The main requirement is .NET 3.5, C# UI Programmer though. I studied about them back in college but never got a chance to i...

Get new ID before insert during transaction in .NET

I'm using ADO.NET to try to get the value I'm about to insert before I insert it in SQL Server 2005. SCOPE_IDENTITY() works fine after, but I'm also inside a transaction if that makes a difference. I literally need to select the next ID, and only the ID and have it available to C# before the insert. ...

Running .Net Software with a SQL database on other systems ?

I've created a software that is used a SQL database. (With VS2008 SP1 & C#) What do I need to run this software on the other system without installing Visual Studio ? ...

C# return non-modifiable list

I have a class which contains a List<Item> I have a getter on the class that returns this. Is there some thing I can do to ensure the user who calls cannot modify the returned List? (Since it's a reference type - I believe changes to the returned reference would affect the list stored in the source object) ...

Library for visualizing object graphs in .NET

Does anyone know of, or can recommend, a library that can recursively visualize an arbitrary object graph in .NET? I need to be able to print out (to the console) a formatted representation of an object graph. For example, given a simple object graph like this: var foo = new Foo(); foo.Bar = new Bar(); foo.Bar.Baz = 42; foo.Bar.Qux = "...

Confusion about the future of .NET Compact Framework

Hi, I'm very confused about the future of .NET Compact Framework. It seems that Windows Phone 7 does not allow installing software manually and a small portion of the .NET Compact Framework exists on such phone. Can anyone tell me the future of .NET Compact Framework? ...

What is the best way to share a static variable between two threads in .net

What is the best way to share a static variable between two threads in .net? I have summarized my question in following code snippet using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace StackOverflow { class ThreadStaticProgram { static string threadSta...

WINFORM control Question (where is the slider?)

How do I go about getting a slider? I am unable to find the slider component inside of the toolbox. ...

Struggling With DataTables in Java...

I'm a .NET Developer trying my hand at Java. My current project has a UI layer, Business logic layer, and a Data Access layer. I'm currently working on the DAL. I'm not connecting to an external database yet; I had hoped to have my DAL classes utilize in-memory dataTables until the DB is in place. In .NET it's very easy to make in-...

Kill process started with System.Diagnostic.Process.Start("FileName")

Hello; I am trying to create an app that will perform actions on specific times (much like the Windows Task Scheduler). I am currently using Process.Start() to lunch the file (or exe) required by the task. I am initiating a process by calling a file (an .mp3) and the process starts WMP (since it is the default application), so far so g...

How to seek a string variable (an html files source code)

How can I seek this sb string variable to get those variables:IMKB's value: 64882,72 how can I get it please show the seek idea using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using System.Net; using System.IO; public partial c...

Performance implications of .net Events

We were having a discussion at the office on how to solve a particular problem and using an event was raised (no pun intended). The response was negative citing misuse and that they can be expensive. I understand the concerns behind misuse and I know that they are just a special multicast delegate but given a scenario where there is at ...

Why does Convert.ChangeType take an object parameter?

The Convert class has been in existence since .NET 1.0. The IConvertible interface has also existed since this time. The Convert.ChangeType method only works on objects of types that implement IConvertible (in fact, unless I'm mistaken, all of the conversion methods provided by the Convert class are this way). So why is the parameter ty...

getting the path of a file in .Net library

Hi, My library project is trying to open an XmlDocument from a file that's also contained in the library. How do I get the path of a file in the library so I can open it? The current directory is not useful and Server.MapPath returns me the path of the main web application (MVC), so how do I get the path of the file in the library? --...

ASP.NET MVC 2 Filtering multiple drop down lists

I know how to approach this problem but i have very little experience dealing with anything web related. The situation is: I have a controller that returns a view with a user control in it. Inside the user control i have 3 drop down lists; one for companies, one for field offices and one for facilities. When the companies ddl is altered...

c#: better threading architecture

Hello, I am interested to get some ideas from you about what would be a good/better threading architecture that respects the rules described below: A thread must be running for the life of the application, in the sleep/wait mode if there is no work in the queue to be performed. A thread must be of a BelowNormal priority (this eliminat...

Regex to find content in html tags

Hello, I need to parse a html file and extract the NeedThis* strings with C#/.net, sample code is: <tr class="class"> <td style="width: 120px"> <a href="NeedThis1">NeedThis2</a> </td> <td style="width: 120px"> <a href="NeedThis3"> NeedThis4</a> </td> <td style="width: 30%"> NeedThi...