C#: Is there a way to return a reference to the selected Item in listview?
Like in the selectedindexchanged, is there a way to return the item of the index that was selected?
...
Given a User DSN how do I create an ODBC connection to that data source in .Net 3.5?
...
I'm really not sure how to approach this, but I am subscribing to events fired within a custom class and ideally I wish to queue them and handle them first in first out as they come in. I am aware of Queue<T> and I think I should use this? but my question is in the event handler when my message is received, would I simply Enqueue() to t...
I'm creating a C# library and am going to be prefix most of the public classes with the protocol they use (TCP, UDP, etc) and I came to a little dilemma: should it be TCPXxxx or TcpXxxx?
There doesn't seem to be a standard in the .NET framework (IPAddress versus TcpClient).
Which you would prefer when working with a lirbary: TCPXxxx or...
I wrote a little GUI wrapper which will execute openRTSP using the Process class. The issue I am having is redirecting the output to a mpeg4 video file. I verified the parameters I am passing are correct by running openRTSP on the command line.
openRTSP.exe -some -parameters -for -video -4 rtsp://video.from.server > video.mp4
The "> vi...
I'm writing a simple custom owner-drawn ListBox control and banging my head against the wall trying to figure out how to implement what seems like a straight-foward feature. My custom ListBox is supposed to work similarly to the "Add/Remove Programs" list in Windows XP. That is, it displays a list of items as usual, but when the user sel...
Hi guys
I have a Winform application (C#) which imports some functions from dll.
Sometimes when running the application i get the following exception:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
I catch it in AppDomain.CurrentDomain.UnhandledE...
I wasn't sure how to word the question but I would like to step through code as it goes through the .NET classes/methods, etc.
Earlier I had asked about how to view the code for the classes in the .NET library and I ended up with .NET Reflector which I promptly downloaded. Now, as an example, I am looking for more info.
I have a metho...
I am using a COM DLL, a function call which returns an ADO RecordSet object and want to refer to it in my C# application.
Have added the reference, put the msado15,interop.adodb dll in the bin directory and debug directory, added assembly key in web.config but still get the following error:
The type 'ADODB.Recordset' is defined
...
Does anyone know if/how I can convert a binary formatted Mac OS X plist file to a plain XML string in C#?
I know there are some plist editors for Windows available that says they support binary formatted plist files, but I need to do this inline in my own application.
...
I have some controls on a WinForm namely: CheckedListBox, ListBox,ListView, TreeView, TextBox.
On
ControlName.Enabled = false;
I have found following results:
ListView and TextBox's BackColor get greyed.
CheckedListBox, ListBox and,TreeView's BackColor does not get greyed.
Why is this behavor? Is it a intented or Bug? and how to...
A WCF service is hosted in a Windows Service (WS).
When the database (SqlServer 2005) goes down a SqlException is thrown due to the actions performed on the database.
What I want to accomplish is that the WS - where the WCF service is hosted - should go down when the DB is also down.
The WS will be restarted manually by the way.
My...
Hi,
I have a set of ComboBoxes. I want to use them mostly like short data-entry TextBoxes, so I have them set to
AutoCompleteMode = SuggestAppend
AutoCompleteSource = ListItems
DropDownStyle = DropDown
What I want to do is to have each ComboBox have a common DataSource (the My.Settings StringCollection) whereby any String ad...
Hello,
In our IDE, for example, Visual Studio, if we display the properties of a System.Windows.Forms.Button control, we see some properties that expose anoter set of properties. For example: FlatAppearance, Font, Location, Margin, etcetera.
I would like to do something similar in a custom control.
I know the code behind is wrong, but...
Hello. I have to check, if directory on disk is empty. It means, that it does not contain any folders/files. I know, that there is a simple method. We get array of FileSystemInfo's and check if count of elements equals to zero. Something like that:
public static bool CheckFolderEmpty(string path)
{
if (string.IsNullOrEmpty(path))...
I'm thinking about developing a framework to simplify running distributed computations in .NET cloud environment of Windows Azure.
Azure currently (and by the time of the release, most likely) is completely unsuited for simple running of distributed queries in the cloud (details). Simple for me is something like DryadLINQ where you can...
I'm writing to Excel file using OLEDB (C#).
What I need is just RAW data format.
I've noticed all cells (headers and values) are prefixed by apostrophe (')
Is it a way to avoid adding them in all text cells?
Here is my connection string:
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
filePath + ";Exten...
I am running the code below and the result is totally different when it runs in Release mode. While in Debug mode, it never collects the object of class A and in Reaelse mode it immediately collects the object of class A.
Can someone explain why.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
...
I have a piece of code that involves multiple inserts but need to execute submitchanges method before I finish inserting in other tables so that I can aquire an Id. I have been searching through the internet and couldnt find how to create a transaction in linq to sql. I have put comments in the code where I want the transaction to take p...
I have a program that uses threads in C#. Is there a way to know programmatically the memory usage of the application? I want to limit the spawning of threads to say 10 megabytes of memory, how would I do that?
...