.net

Can the .netTiers framework be used with windows forms

Does nettiers available for windows form? it is very good template for codesmith code generator. asked because of : this http://community.codesmithtools.com/nettiers/f/16/p/11316/43250.aspx#43250 if yes give me link for more information, ...

.NET 2.0 C# Treeview Drag/Drop within TreeNodes

I am interested in capturing a drag/drop event that will start with the user dragging an existing TreeNode somewhere within the TreeView. While the user is dragging the TreeNode around, I am interested in capturing when the node has been dragged between two tree nodes. When the user does this, I wanted to display a hash mark in-between...

How can I reference TeamFoundation assemblies in my project?

I need to reference Team Foundation assemblies in my project but I cannot. When looking for Microsoft.TeamFoundation.* in the GAC I cannot find any assemblies. Then I browse to C:\windows\assembly and here I find the assemblies that I need. When I select all or one of the assemblies to create a reference nothing happens. The dialog 'bl...

A probably simple regex expression

I am a complete newb when it comes to regex, and would like help to make an expression to match in the following: {ValidFunctionName}({parameter}:"{value}") {ValidFunctionName}({parameter}:"{value}", {parameter}:"{value}") {ValidFunctionName}() Where {x} is what I want to match, {parameter} can be anything $%...

Accessing objects from other classes in ASP.NET (VB)

Please forgive the newb question. I am very new to .NET so don't assume I've done something basic. In ASP.NET I have a form that has a Textbox named txtOutput and a button. In the main file.aspx.vb I can call a function from the button handler and in that function I can have txtOutput.Text = "Some Message" with no problem. I have ...

Default access rights of files and directories

I have an application that is installed on Vista PC's by a user with elevated user rights (and administrator via UAC elevation prompt). The installer writes some files to a folder in the %APPDATA% folder. When the user (without elevated user rights) run the application, the files (and created folders) in the shared %APPDATA% (c:\Progr...

How can I delete specific record from mshflexgrid?

How can I delete specific record from mshflexgrid? For example mshflex grid is showing data from monthly_instal table. Now I want to delete record from this table. I have written code to delete record from that table but its deleting record one by one like 1 2 3 4. I want to delect specific record whatever it is 3 or 4 or 2 or 1. Even I ...

How do events cause memory leaks in C# and how do Weak References help mitigate that?

There are two ways (that I know of) to cause an unintentional memory leak in C#: Not disposing of resources that implement IDisposable Referencing and de-referencing events incorrectly. I don't really understand the second point. If the source object has a longer lifetime than the listener, and the listener doesn't need the events a...

What are the disadvantages of using P/Invoke

I'm working already a good time with the .net framework. In this time there were some situations, I used P/Invoke for doing things that I couldn't do with managed code. However I never knew exactly what the real disadvantages of using it were. That was also the reason why I tried not to use it as far as possible. If I google, then I f...

Subversion: Branch per Environment?

I am currently working on a project in .NET which consists of several logical layers and multiple front-ends. Here is a rough representation of our SVN structure: trunk ---doc ---lib ---src ------console ---------console.vbproj ------domain ---------domain.vbproj ------... ------web ---------web.vbproj ---.sln All of our day-to-day de...

Serialization/Deserialization of Parameters - WCF Service Call doesn't work

I have a simple WCF service method: [OperationContract] public SetupGameResult SetupGame(long player1Id, long player2Id, long myPlayerId) { if(player1Id == 0 || player2Id == 0 || myPlayerId == 0) { throw new ArgumentException(); } ... // other code } I call this Service just in one ...

Method for associating state information with an ASP.NET control?

What is the best method or best practice for associating state information with an ASP.NET control? The context is that I'm dynamically generating a user poll. I may have several polls to choose from that the user could answer. I will dynamically generate the label prompt, radio selections, validation, and submit button. Currently I am ...

A question on the backward/forward compatibility of csc.exe

Hi, Is the .NET command line compiler (csc.exe) in VS2010 a full, .NET 4.0 compiler? Furthermore (And this may sound stupid), if I write code in .NET 4.0 but it only makes use of .NET 2.0 features and nothing beyond that, would it compile with a .NET 2.0 compiler? Thanksa ...

Why doesn't this SetBinding ImageSourceProperty Work?

let mtvCapView = Rendering.MTViewerCaptureViewProvider(subRead) let image = Image() let imageBinding = Data.Binding("ImageElement") imageBinding.Source <- mtvCapView image.SetBinding(Image.SourceProperty, imageBinding) .... Grid.SetColumn(image, 1) grid.Children.Add(image) The MTViewerCaptureViewProvider class exposes an property ...

The current co-ordinates of a given WPF Control

Given a System.Windows.Controls.Control, how can I find the top left and bottom right corners of the control, in pixels? Also, how can I then set the said corners? I want to be resizing or moving the control arbitrarily based on where it currently is. I'm in C#. Thanks. ...

C# Object Pooling With Interlocked.Increment

I have seen many good object pool implementations. For example: http://stackoverflow.com/questions/2510975/c-object-pooling-pattern-implementation. But it seems like the thread-safe ones always use a lock and never try to use Interlocked.* operations. It seems easy to write one that doesn't allow returning objects to the pool (just ...

Sending Fax through .NET/C#

How do I go about sending fax in .NET? We have a fax server through which we need to fax documents to clients. Since we have a fax server, I don't imagine that I have to configure a fax modem on my machine, right? It would just go through the fax server? Are there any good free (or cheap) Fax APIs out there? IN my research I've come a...

Using a NetworkStream to transfer a file

I am having trouble transferring a file to a client from a server program. A few problems I would like to address. First is that I make the byte array 6000 bytes big and its always that size. Is there a way to maintain the correct file size? Also with the way the code is now, the program hangs. It works when I take it out of the while lo...

NetUserGetInfo/NetLocalGroupGetInfo returning error 1722

I have the following code (VB.NET) which is designed to determine if a given account name refers to a local group or a user account. This will only be called for accounts/groups on a machine, not a domain. Module netapi Private Declare Function NetUserGetInfo Lib "Netapi32.dll" ( _ ByVal ServerName As String, _ By...

Why is there no SortedList<T> in .NET?

Why is there only a SortedList<TKey, TValue> which looks more like a dictionary, but no SortedList<T> that is actually just a list that is always sorted? According to the MSDN documentation on SortedList, it is actually internally implemented as a dynamically-sized array of KeyValuePair<TKey, TValue> that is always sorted by the key. Wo...