.net

Using VirtualMode on a DataGridView when the number of rows/columns isn't known

I need to display an unknown length sequence of dictionaries with unknown keys efficiently in a data grid. This sequence is the result of a potentially slow LINQ query that could contain any number of results. At first I thought that VirtualMode on DataGridView was what I was looking for but it appears that the number of rows and column...

Regarding "Conflicting changes to the role" Exception

Hi, Actually I am getting an exception "Conflicting changes to the role 'TableName' of the relationship 'DataModel.FK_TableName_RelateTableName' detected" when ApplyChanges method is called from the ObjectContext. I dont have any idea what this exception is all about. I just wanted to know the cause of this exception. Thanks, Burhan G...

How to highlight a taskbar item

In almost all messengers when your IM window is minimized to the taskbar, IM taskbar item changes color or gets brighter when you have a new message. I've been looking for any help on how to do this using .NET Winforms or WPF Any code samples? ===================================================================== EDIT: I used FlashWind...

Mp3 Header information edit

I want to edit the header information of an existing MP3 file. Can any one suggest how to achieve it in C#.net? I want to include some details in header like, company name, description, website link etc. ...

How to convert from base-256 to base-N, where N is higher than 16?

Dear ladies and sirs. I need to convert an array of bytes to another base, namely 85. In math terms the question is how to convert from base-256 to base-85 in the most efficient way? This question is inspired by my previous question - http://stackoverflow.com/questions/2827627/what-is-the-most-efficient-way-to-encode-an-arbitrary-guid-...

Registering instances with MEF

I have to register an object instance into a container. I can't use the generic ComposeExportedValue<T> since I don't know what T is at compile time. The method I need is something like this: container.RegisterInstance(Type someType, object instance) Any ideas? Thanks. ...

How can I make this work with deep properties

Given the following code... class Program { static void Main(string[] args) { Foo foo = new Foo { Bar = new Bar { Description= "Martin" }, Name = "Martin" }; DoLambdaStuff(foo, f => f.Name); DoLambdaStuff(foo, f => f.Bar.Description); } static void DoLambdaStuff<TObject, TValue>(TObject obj, Expr...

.Net: how can I have a combobox with multitple fields of its data source as Displaymember?

hi How can I have a combobox with multiple fields of its data source as its display member without adding additional columns to its data source? I mean I wanna to have a combobox with displaymember like "ID" + "-" "Name" . 1 - Black 2 - White 3 - Red I DO NOT want to add additional column to its data source. Thank you ...

Socket server stops accepting connections after a period of time

We have an async socket server written in C#. (running on Windows Web Server 2008) It works flawlessly up until it stop accepting new connections for an unknown reason. We have about 200 concurrent connections on average, however we keep a count of both connections created and connections dropped. These figures can reach as high as 10...

My C# program running as Windows Service is blocking Windows XP from hibernation

I have Windows Service written in C#. It starts two threads, one is pooling a Web Service, second is waiting on a Monitor object for a new job to arrive. Besides that, the main thread acts as a WCF service host using NetNamedPipeBinding. It lets the client application to register a callback and then sends notifications back. The proble...

Howto create a C# Application that blocks pc hibernation?

I want to make a program to wake me up, but if I leave it and go to sleep the pc ends up sleeping. How can I force it to never sleep if this application is running? I'm on Windows 7 x64. ...

how to load c# object side by side

We have serialized value of some objects persisted. Now we want to make substantial changes to some objects. So what i want to do is load older version of object using old assembly then deserialize and serialize again with newer version of the object. I can have convert method which can transform old object to new one. i have been con...

Split, encode and join video parts in C#

It is possible to split file into many parts.Is it possible every part encode and after that join them again? The idea is to encode one video on more computers. In .NET Thank you ...

WPF with code only

I've seen a lot of questions about the merits of WPF here, and essentially every answer says it's the bee's knees, but essentially every answer also talks about things like XAML, in many cases graphic designers and Expression Blend etc. My question is, is it worth getting into WPF if you're a solo coder working in C# only? Specifically,...

Reading Excel file with C# - Choose sheet

Hey Guys I'm reading an excel file with C# and OleDB (12.0). There I have to specify the select statement with the name of the sheet I wish to read ([Sheet1$]). this.dataAdapter = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connectionString); Is it possible to select the first sheet, no matter what name? Thank you. ...

WinForms (C#) Databinding Object to Checkbox.Checked Property

Hello, I'm writing a WinForms app, and am trying to bind a boolean property on a .NET object to a Checkbox's "checked" property. I am successfully creating the binding, but when I change the source property's value from false to true (I have a button that toggles it), the checkbox's "checked" property does not reflect that change. if (...

Developing for mobile devices and desktop

Hi, I'm starting a new project. It will run on devices running Windows CE, Windows Mobile 6 and will also have a desktop version. The software will connect to some equipments through the serial port, using it's own protocol. Basically it will: connect to the equipment send and receive info read and write binary files These tasks wil...

How to get all links avaliable from server on some port?

So I have lots of links like address:port/Bla-bla/bla-bla/file/blabla234times/ created by some server (like VLC) how can I get all links (list of them) avaliable from server (abstract server working on windows) from my C# programm? So how to get a list or URLs of ALL existing files and folders on server. We have adress and port. (no HTM...

Parallel computing in .NET

Since the launch of .NET 4.0 a new term that has got into the limelight is parallel computing. Does parallel computing provide us some benefits or is it just another concept or feature? Further is .NET really going to use it in applications? Further is parallel computing different from parallel programming? Kindly throw some light on t...

P-invoke call fails if too much memory is assigned beforehand

I've got a p-invoke call to an unmanaged DLL that was failing in my WPF app but not in a simple, starter WPF app. I tried to figure out what the problem was but eventually came to the conclusion that if I assign too much memory before making the call, the call fails. I had two separate blocks of code, both of which would succeed on their...