.net

Silverlight Assembly.CodeBase problem

"This member has a SecurityCriticalAttribute attribute, which restricts it to internal use by the .NET Framework for Silverlight class library." Is there a way to access this information? (The original location of the Silverlight assembly). ...

How to do full duplex programming with .NET?

After seeing the Google Wave demos, I thought of incorporating "real-time" capabilities into my web application, where one user will be able to see text another user is typing in as it happens... Besides the soft real-time capabilities built into .NET based on how the framework handles threads... Is there anything else I would need? I...

Return MembershipUser using WCF service

Hi all, I have WCF service to get users from the ActiveDirectory. I receive parameter from the request (user name) and create response with MembershipUser property. from some reason, the connection get close. the service operation find the user and create the response successfully. when executing the row: "return response;" i got excepti...

Getting static field values of a type using reflection

I've got a set of static "enumeration" classes that I'm using to hold meaningful variable names to represent meaningless code values I receive on an input file. Here's an example of one. Public Class ReasonCodeValue Private Sub New() End Sub Public Shared ReadOnly ServiceNotCovered As String = "SNCV" Public Shared ReadOn...

Can I wrap the node text in a WinForms TreeView

The ASP.NET TreeView has a NodeWrap property, is there an equivalent way of accomplishing the same thing in a WinForms TreeView? EDIT: Thanks for your suggestions of other controls, unfortunately my client will not permit the use of third-party controls. ...

Conversion of VB6 HTTP request to VB.Net 2.0

I'm attempting to update a legacy VB6 component (not written by me) to the .NET platform. There is one function which posts an XML string to a URL: Function PostToUrl(ByRef psUrl, ByRef psData, Byref psResponseText, ByRef psErrorMsg, ByRef psUsername, ByRef psPassword) On Error Resume Next Dim objWinHTTP PostToUrl = False psError...

DataGridView, DataTable, SqlDataAdapter and SqlCommandBuilder - disable deletes

I have a WinForm that has a DataGridView table. It is bound to a DataTable in conjunction with a SqlDataAdapter and SqlCommandBuilder. What is the best way (easy and easy to manage) of disabling Deletes but allowing Selects, Updates, Inserts? Is there a one line property I can set on the grid? That is how I would prefer to do it. ...

Receiving the Same MSMQ Message Twice?

I have an MSMQ-based system with three layers that communicate with each other. For the sake of simplicity, I'll refer to them as Layer 1, 2, and 3. They sit like this: Layer 1 <-> Layer 2 <-> Layer 3 So Layer 1 talks only to Layer 2, Layer 3 talks only to Layer 2, and Layer 2 talks to both others. I have four queues for this, Layer1...

How do I create a row specific sql cache dependency?

I want to use data caching on my .net C# application. So far I added data caching and added sql cache dependencies on specific tables. But thats not good enough. These tables will be updated too frequently but not relevant to a lot of the cached objects. This will make the data caching almost useless because it will be flushed to frequen...

Custom shaped text box/edit control in .net?

I'm looking for a way to display and edit text inside a custom shaped box (e.g. a circle.) The text needs to use as much of the allowed space as possible, so just positioning an edit box inside the shape is not good enough. Requirements: 1) Given a GraphicsPath and a string, draw the text within the path. If the text overflows, truncate...

How can I demand access to a Windows share in a .NET thick-client app?

We have a thick-client that needs to access resources on a share where a client may not be logged on. The client might be on a Windows domain or it could be a mixed environment without a domain, so the user would have to log on to the server locally. In the past, one work around was to create a shortcut on the user's desktop to the share...

.NET DataReader and SQL joins

string query = "SELECT * FROM table1, table2 WHERE table1.Id = table2.fId"; ... using(IDataReader dataReader = db.ExecuteReader(CommandType.Text, query)) .. string value = dataReader["table2.field"]; //dies I'm currently writing some .NET code which involves executing a join query and then accessing the returned data using a ...

.NET and TSQL "For Xml Auto" Splits XML Result

I'm using some TSQL with 'For XML Auto'. If I run the TSQL in management studio, I get a single row. If I fill the DataTable using the DataAdapter.Fill() command, I get two results. It appears that the results are split in the middle of one of the tags. It is not a huge XML file, in fact its quite small (perhaps 20 lines), so size is...

WPF - inherit from System.Windows.Application

I would like to have my own application class that inherits from System.Windows.Application. The problem is that in the Application.xaml file, I have to declare the app like this : <src:MyBaseApplication x:Class="MyApplication" xmlns:src="clr-namespace:MyApplication;assembly=WpfTestApplication" xmlns="http://schemas.microso...

How to create object collection from an xml

I have an xml like the following <DataCollection> <Data> <Name>John</Name> <Age>30</Age> </Data> ... more person </DataCollection> I want to create an object(or some type) collection with Name, Age as fields. One problem that I have is I don't know the structure before hand (all i know is, there will be DataCollection an...

.Net FileWatcher fails for ~80+ files

I'm using .net 2.0 filewatcher to watch a folder for new files. It works perfectly except when I put more than ~80 files at once. The event just doesn't trigger anymore. It's as if the filewatcher is set to keep track of certain number of files. For the time being I have asked the user not to put more than 50 files at a time and that se...

How to get a programmatic list of all loaded assemblies (referenced) in the .NET Compact Framework

I am running on Windows CE and using the Compact Framework. I need to get a list of all reference assemblies that my application has loaded. It would be nice to be able to get to the AssemblyName (object) of these assemblies. An example is like getting my running assembly by doing: Assembly.GetExecutingAssembly(); except I need to get t...

ELMAH vs Enterprise Library Exception Handling Block

My team is currently in the process of building an ASP.NET MVC application, and we're trying to decide which of these frameworks to implement to deal with error handling and logging. What are the reasons for choosing one of these over the other? ...

How can I get DOMAIN\USER from an AD DirectoryEntry?

How can I get the Windows user and domain from an Active Directory DirectoryEntry (SchemaClassName="user") object? The user name is in the sAMAccountName property but where can I look up the domain name? (I can't assume a fixed domain name because the users are from various subdomains.) ...

What is REST?

Possible Duplicate: What am I not understanding about REST? What is REST? How does it relate to WCF? I have been asked to look into RESTful implementation of services. Can you please point me to links that would be helpful for beginners. I am a .NET developer with a decent knowledge of ASP.NET ...