.net

WPF bind control size

I have a StackPanel with a list of custom user controlls that I would like to resize. I would like the user to be able to drag a slider and scale the control size up and down. Is there a way to bind the control width to a slider value? Something similar to: <MyControl Width="{Binding Path=SizeSlider.SelectedValue}"/> Is this possible...

Currency Library

I am looking for a .Net class/library to use with currency acronyms in the same way the TimeZoneInfo class works with timezones. I need to populate a drop down list with these acronyms and store the result in a databse. This value will be used to retrieve up to date exchange rates from the web at a later stage. Any ideas? :] Thanks e...

How to trap the OutOfMemoryException in .NET (Excel add-in)

I am getting OutOfMemory Exception in my .net addin. The addin is using large number of managed and unmanaged objects. Is there a way to trap this exception? Updated: I think any application can get an OutofMemory exception if it processess a large amount of data that needs to be processed and not freed periodically. Suppose I have a me...

To get the path of file in a project in vb

hi guys, I am running windows application in vb.net.I have a xml file named mail.xml in folder named XmlFiles.In default.aspx.vb i have to get the path of mail.xml.What code i hve to write to make it possible? ...

3-Tier .NET applications resources

Hi, A friend of mine doesn't have much experience on 3-Tier applications design and development and he would like to broaden his knowledge on this subject. Can you point me to good online resources or books on it? It would be great if they started from the principles. I was thinking of this tutorial as a good starting point. What resou...

Use of Enterprise Service in .NET for a transaction object that does not write to DB

I am looking at using the DTC in Enterprise Service for managing a transaction that i need to run. What is unusual in this transaction is that the transaction will affect a data base and a number of hardware devices that we access through a native interface. What i am curious to find out is if thisis actually possible. i.e. can i write a...

JclDotNet, and some odd calling patterns using assembler

We have our own glue-layer-code-thingamajig that allows us to host the .NET runtime in our Win32 Delphi program. This has allowed us to do a gradual transition to .NET over time. But, we have some problems with it from time to time, and yesterday I saw an answer here on SO that referred to Jcl's .NET host implementation, so I thought I'...

Video processing in .NET

I want to open .avi file (preferably any video file), to work with that video as a sequence of bitmaps (arrays) and then display it on the screen or save it to the file. What options do I have in .NET? ...

Marshal.ReleaseComObject ?

I'm playing around with these two native win32 functions: [DllImport( "oleacc.dll" )] public static extern int AccessibleObjectFromWindow( IntPtr hwnd, int dwObjectID, ref Guid refID, ref Accessibility.IAccessible ppvObject ); [DllImport( "oleacc.dll" )] public static extern uint AccessibleChildren( Accessibility.IAcce...

C#: How to parse arbitrary strings into expression trees?

In a project that I'm working on I have to work with a rather weird data source. I can give it a "query" and it will return me a DataTable. But the query is not a traditional string. It's more like... a set of method calls that define the criteria that I want. Something along these lines: var tbl = MySource.GetObject("TheTable"); tbl.Ad...

Is there an AppDomain for every C# program?

Is there an AppDomain for every C# program even if we do not specifically create an AppDomain? Why is it required? I have read about third party assemblies crashing the entire application if we do not load them into separate AppDomain. I didn't get that point well. Can anyone explain this also. ...

Parsing CSV file with un-escaped quotation marks and commas in .NET

I was wondering if someone could help me. I have to parse data from a csv file and put this into a db table. An example of the data is as follows: "first field", "second , field", "third " Field " ", "fourth field" As you can see there are quotation marks and commas embedded in the fields. I was using ADO.NET but it had issues with t...

How to call the method from a MethodCallExpression in c#

Hello, I have a method call expression and try to invoke the method. I figured out a way, but I have problems in retrieving the parameter values since not every argument is described with a ConstantExpression. Expression<Action<T>> = t => t.DoSomething(Par0, Par1, Par2); MethodCallExpression methodCallExpression = selector.Body as Meth...

Calling a COM object from .Net C#

I am trying to access a COM dll(eObjectBroker) from my C# application. Here are things I have done. run tlbimport with eObjectBroker.dll to get the assembly. I get two assemblies, as COMSVCLIB is referenced from eObjectBroker. So I have eObjectType.dll and COMSCVLIB.dll I add reference to these two assemblies in my .Net c# project. I a...

With NAnt, How to use C# 3.0 compiler while targetting .NET 2.0 runtime?

I'm using NAnt 0.85 to build a legacy project. The script itself uses the csc task (not the msbuild task) and works fine. The project is on its way to migrating over .NET 3.5. We already use VS2008, and C# 3.0, while still targeting .NET 2.0 framework runtime. Now the problem occurs when we want to upgrade our NAnt scripts, to compile ...

How to generate xs:Date in WCF OperationContract parameter

For parameters to an OperationContract that represent a date only (no time component or timezone designator), it is desirable to use xs:Date, to avoid any ambiguity or problems with timezone conversion between client and server. WCF currently only supports xs:DateTime for serializing DateTime parameters. What is the easiest way to gene...

What is the "Browser File" in Visual Studio 2008 and why may we need it?

While adding a new file in VS 2008 website, I found something called "Browser File". Does anyone know what is this, how to use and when to use? ...

Many to many object to object relation in C#

Hi, I am working on a small educational project to exercise perst.net. We have a tiny design problem, that is how to best resolve the relation between two classes of objects, that is the participant and championship. It is a many to many relation as participant can take part in many championships and championships can have a multiple p...

How to check for null values?

I have an integer column that may have a number or nothing assigned to it (i.e. null in the database). How can I check if it is null or not? I have tried if(data.ColumnName == null) { ... } This doesn't work either (as SubSonic does not use nullable types (when applicable) for ActiveRecord) if(data.ColumnName.HasValue) { ......

Designing a client/server program, design question (.Net)

We are designing a client/server program and I need some help with a design decision. The server side of the program will run as a service on a number of Windows servers, the service is monitoring those servers, when needed the service will email us a report. The client will be used to control and manage the services running on the ser...