.net

Trouble with SOAP Web Service

I am trying to use a SOAP Web Service provided by a third party. I am having trouble getting the service to work correctly in .NET 3.5. I have added it as a web reference and all seems to go well. Problem is when I call the service all I get returned is a NULL object. I have worked with the provider and there service appears to be wo...

RijndaelManaged Key generation

I need to encrypt data and store it in a file and later be able to decrypt it back. For this I am using RijndaelManaged class. Now I do not want to keep the key hardcoded in the code. After some googling I found this method - Here the key is generated but then all other values like passphrase, salt and IV are hardcoded. I do not have th...

How should I manage toolbars, menus and context sensitive elements in a sound way?

Hello fellow developers, I'm currently developing a WinForms application in C#, and need some input on how to manage toolbar buttons, menus and other context sensitive elements. What is the best practice for this? I've found the article 'Use Design Patterns to Simplify the Relationship Between Menus and Form Elements in .NET' on MSDN b...

What's the closest thing to pyparsing that exists for .NET?

What I'm especially interested in is the ability to define the grammar in the code as ordinary code without any unnecessary cruft. I'm aware I could use IronPython. I don't want to. UPDATE: To further explain what I'm looking for, I'm including some sample pyparsing code. This is an incomplete parser to convert emacs shortcut keys to ...

DataGridViewCheckBoxCell question regarding when its value gets assigned

Hi, I have this function to see if all of a certain columns DataGridViewCheckBoxCell values are True. It however fails because it seems to think the current value is false. I'm running this code in the _CellContentClick event, is there somewhere else I could run this, after it's assigned the value to the cell? Private Function AllTasksA...

General best practice for updating a record and its associated relationships in Linq-to-SQL

I have a very general question about updating a record in Linq-to-SQL. Suppose, in my data model, I have a base record (Table - Person) with an m:m relationship to a set of Categories (Table - Category). Therefore, I have an associative table (PersonCategory) that has foreign keys to both a PersonID and CategoryID. When I want to upda...

C# : WCF Service with IXMLSerializable member turns into DataSet

.NET I have a web service, one of the data members of a message implements IXmlSerializable, when I do "Add Service Reference" that member becomes a DataSet. I am trying to pass a serialized Expression<TDelegate> as a parameter to the web service. Q: How do I make a DataSet out of the IXmlSerializable instance on the client side? ...

Compact Framework Unit Testing via Microsoft.VisualStudio.TestTools.UnitTesting

I want to write Unit Test suite for my .netcf 3.5 C# application and I want it to run on device. How do I setup to do this? I am using Microsoft.VisualStudio.TestTools.UnitTesting. ...

Difference among three kinds of dependency properties in .NET Workflow Foundation.

In .NET Workflow Foundation, there are three kinds of dependency proprieties: instance properties, meta properties, and attached properties. Can someone explain what the difference and proper usages are? Thanks. ...

Is it possible to get a null reference error from the ListBox.Items property?

EDIT 11-20-2009: This question was posted quite some time ago, but the problem just crept up again this morning; so I'm hoping somebody else can provide some insight (though the answers provided already have been helpful). Once in a blue moon in our production environment we get a NullReferenceException from referencing the Items proper...

How to prevent a new WPF form from stealing focus?

I have written a simple MSN-style program that will send and retrieve messages using WCF. The main form contains a Textbox to type in the message to be sent. In the background the application polls the server every few seconds for new messages. When a new message is received a new window is opened to display it. This has to be done on th...

.NET (2.0) service can't see network share

I have a C# .NET service that runs as DOMAIN\username on a windows server and it needs to access a network share \\share\export docs$\. If I'm logged into the machine (as DOMAIN\username) I can see the share and I have even mapped it to X: and tried to use that. I set the path in app.config (and restart the service) and if I use a path ...

XmlSerializer.Deserialize question

I am hoping someone has been through this pain ... I have a XML <data> <elmt1>Element 1</elmt1> <elmnt2>Element 2</elmnt2> <elmnt3>Element 3</elmnt3> </data> I need to deserialize to an object that serializes to a different root name with everything else remaining the same. for example, <dataNew> <elmt1>Element 1...

Can you/should you use SQL Server Service Broker with .NET applications?

I have many operations in the database that need to trigger application code. Currently I am using database polling, but I hear that SQL Server Service Broker can give me MSMQ-like functionality. Can I listen to SQL Server Service Broker queues from .NET applications running on a different machine? If so, should I do it? If not, what w...

Can Python encode a string to match ASP.NET membership provider's EncodePassword

I'm working on a Python script to create hashed strings from an existing system similar to that of ASP.NET's MembershipProvider. Using Python, is there a way to take a hexadecimal string and convert it back to a binary and then do a base64 encoding, somehow treating the original string as Unicode. Let's try some code. I'm looking to re...

A definite guide to API-breaking changes in .NET

I would like to gather as much information as possible regarding API versioning in .NET/CLR, and specifically how API changes do or do not break client applications. First, let's define some terms: API change - a change in the publicly visible definition of a type, including any of its public members. This includes changing type and mem...

How can I make sure my DB cache is current?

I have an expensive operation that calls the database, and populates an array of objects for use in comboboxes. Because it can take ~2 minutes, I cache it on start up. When the user needs to use these comboboxes, I need to make sure they have the current data. How can I do this? ...

How to programmatically connect to IIS 7

Hey all, I am trying to connect to IIS programmatically. I find there are a ton of examples online, but I can't seem to get any to work and have tried quite a few variations Every time I try the following code the object that is returned has this error for each property: ..."threw an exception of type 'System.Runtime.InteropServices.C...

WinForms RichTextBox: how to perform a formatting on TextChanged?

I have a RichTextBox that I want to re-format when the contents of the RichTextBox changes. I have a TextChanged event handler. The re-formatting (changing colors of selected regions) triggers the TextChanged event. It results in a never-ending loop of TextChange event, reformat, TextChange event, reformat, and so on. How can I disti...

Deserializing from data recieved asynchronously

In my application, I have three collection objects which store data. The data which populates these collections is downloaded from an XML file on the web. The three data classes are very simple, the following is a typical example: [SerializableAttribute()] [XmlTypeAttribute(AnonymousType = true)] [XmlRootAttribute(Namespace = "", IsNul...