.net

DropDown list with checkboxes

How can i make a dropdown list with checkboxes ? I have a windows app ( vb.net) and the checkboxlist control is not real an option with the available space on my form. Thanks. ...

Predicting the length of an encrypted string

I am using this for encryption: http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx Is there a way I can predict what the encrypted text will look like? I am converting the encrypted output to text so I can store it in the db. I just want to make sure the size of the database column is large enou...

Shifting -bytes

Hello, Now I have an array of 7 bits bytes or a string I want to take the last bit from the second byte and add it to the right most of the first and so on which will result in a new 8 bits byte Is there any direct way to do that than using loops and arrays? Example http://www.dreamfabric.com/sms/hello.html How can I do th...

how to organize the code similar to #region/#endregion in .NET?

Hi, While the code is growing big it is getting harder and harder to keep everything well organized. One thing I liked very much the time I developed in .NET was #region/#endregion which enabled to organize the code in logical groups and made further organization much easier. Does anyone know whether there is any similar code organizat...

Is it foolish of me not to use NHibernate for my project?

I am working on a .NET web application that uses an SQL Server database with approximatly 20 to 30 tables. Most tables will be included in the .NET solution as class. I have written my own data access layer to read the objects from, and write them to the database. The whole thing is consist of just a few classes and very few lines of cod...

Integrating Rewards Programs with Credit Card Processing in .NET

There are several rewards programs that integrate directly with credit cards at participating merchants. I'm looking for some information on the integration process, and would like to know details about the credit card processing workflow as well as the rewards program workflow, as well as any APIs I should use for this process. ...

Allowing to add elements to a list in xaml

I've created a custom control that I insert into my window with the following code <controls:ListExpander Text="Class Diagrams"></controls:ListExpander> The control in question contains several subcontrols, among others, a list. How can create the setup, so I can specify items that should be added to the list? Eventually I'm looking f...

WCF REST service - DataContract stops constructor?

Hi, I have a strange problem that's happening with my WCF REST service. For an operation where it accepts data, let's say it accepts the Foo class: [WebInvoke(Method = "PUT", UriTemplate = "users/{username}")] [OperationContract] public void UpdateLoginUser(string username, LoginUser userUpdated) { [...] } Now my LoginUser class inh...

OracleClient + TNSless connection with .NET

We are using System.Data.OracleClient and the abstract base classes DbConnection, DbCommand (etc) to connect to Oracle. The connection works fine in our development stages. During staging we encounter the error ORA-12514: TNS:listener does not currently know of service requested in connect descriptor. Our goal was to connect without...

Sever a .NET COM Interop assembly from its hosting process

When an ActiveXObject is hosted in a Windows Desktop/Sidebar Gadget, that ActiveXObject is sort of cached and the DLL file for it is locked (meaning it cannot be moved, deleted or renamed). The problem is this; when the gadget is subsequently closed, the DLL is still locked by Windows Sidebar and it cannot be removed. This causes a sig...

How to encrypt query strings in aspx.net?

Title I hope says it all: How do I encrypt query strings in aspx.net? P.S. I realize that this does not offer security. I'm just looking to obfuscate a puzzle. P.P.S Though I marked CKret's answer as the correct one (for the question as worded I believe his is the most correct answer). However, for myself, I'm just going to try ChoasP...

COM object that has been separated from its underlying RCW can not be used - why does it happen?

Hi. I sometimes get the following exception: COM object that has been separated from its underlying RCW can not be used Sample code: using (AdOrganizationalUnit organizationalUnit = new AdOrganizationalUnit(ADHelper.GetDirectoryEntry(ouAdDn))) { using (AdUser user = organizationalUnit.AddUser(commonName)) { //set some properti...

Where can I set the initial value of CurrentUICulture in Windows XP?

I'm trying to make my application support multiple languages. I've made some satellite assemblies and now I want to test what the app will look like when run on a French machine, for example. In [Control Panel->Regional And Language Options] I can select French (France) in the Regional Options tab, and I can select French (France) in th...

Is there a JProfiler equivalent for .NET?

I am used to profiling Java programs using Jprofiler which can give you a CPU Percentage breakdown for each class and method. Is there a similar tool for .NET? ...

DataGridView displays empty cells when bound to typed DataTable

I'm creating a simple application that simply populates a DataGridView with a strongly typed DataTable. My problem is that all the cells show up empty despite containing data, I have a CellDoubleClick event which can pick up the underlying value of the cell (which is typed as expected) but the column is shown as empty. Objects of type ...

ObjectDataSource - SelectParameters using default value rather than FormParameter

Hello all, I am using c#.net. I have a search form (within a View), when the user provides the correct details for each textbox and presses the search button, it redirects to another View within the same WebForm. I am using LINQ and ObjectDataSource to pull back the results for the database. As the query requires parameters (used wit...

"Read-Only" Entity Framework? I'm trying to use RIA Services, EF, and Silverlight

I'm trying to present MySQL server data in a silverlight client and my current plan of attack is to use Entity Framework to MySQL with RIA Services providing the data access between the Silverlight Client and Entity Framework. However, I'm only trying to present data to the user and I do not want the possibility of me or someone else be...

Alarm clock application in .Net

I'm not really writing an alarm clock application, but it will help to illustrate my question. Let's say that I have a method in my application, and I want this method to be called every hour on the hour (e.g. at 7:00 PM, 8:00 PM, 9:00 PM etc.). I could create a Timer and set its Interval to 3600000, but eventually this would drift out...

Error Connecting to Third Party App via COM: mscorlib Exception from HRESULT: 0x80040202

One particular user is getting an exception when connecting an application I created to a third party app using COM. The connection fails with the following error: Source: mscorlib Message: Exception from HRESULT: 0x80040202 This software works fine for other users. Any ideas what could be going on? The error occurs just before the...

.NET AnimateWindow

I am trying to make a notification window like Outlook uses when you receive a new email. I have a modeless form for the notification window with two Label controls on it to display the notification info. To get the fade-in effect, I am p/invoking the Win32 AnimateWindow function. Everything seems to be working alright except for one ...