I have a List of structs:
public struct NodeIntHwnd
{
public TreeNode Node; // a treeNode with a string
public int Level; // level of depth
public IntPtr Hwnd; // not important
};
They are sorted in a List sth like:
{
This is a node, 0 // root
This is a node, 1 // level down
This is a node, 2...
A large set of code analysis rules is defined within Visual Studio and FxCop but which one do you find to be the most important and most critical to conform and why?
Retrospectively, could any of the rules have saved you a lot of time/money if you had enforced them from the start or at least before your product was released?
...
Hi There.
I work for a research department in a big company and we use .Net platform to build our prototypes (That means the product team always reproduce our work if the prototype is 'useful'.).
We also hire interns for our projects. Some of the interns are mainly doing research, thus code less. But anyway, interns need to do some co...
Is it somehow possible to detect whether program was started by a user or it was started automatically from registry at Windows start up?
...
Consider 2 DataGridViews both with SelectionMode = RowHeaderSelect. In grid1 I have 2 columns; a TextBox and a CheckBox. In grid2 I have 2 columns; a ComboBox and a TextBox.
When I click on the RowHeader, the focus goes to the first cell, not the RowHeaderCell. When I press the DEL button, the contents of the cell is deleted (TextBox ...
My tab-delimited file is something like this:
ISO ISO3 ISO-Numeric
AD AND 20
I've been trying the following code with no luck.
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
|DataDirectory|;Extended Properties='text;HDR=Yes;FMT=TabDelimited'");
OleDbCommand cmd = new Ole...
Hi
I have a Web App and a service sitting on the same machine and communicating via message queues. The problem I'm experiencing is that about half of the time the messages I send from the service are not arriving to the reading code in the web app. Some of them will arrive and some will not. The messages are sent with at least 1 second...
I am trying to capture a screenshot using CopyFromScreen. However method signature is a bit confusing for me.
It looks like this:
public void CopyFromScreen(
Point upperLeftSource,
Point upperLeftDestination,
Size blockRegionSize
)
Why there are 3 parameters instead of 2? And why there are both upperLeftCorner. In my unde...
i am Developing a Pharmacy Management Project and Every Medicine has it's own bar code so i want to read this barcode when i insert this medicine in the DB or to generate bar code if the medicine does not has a bar code and to read it will the Sales man sale it , so i want to know how to read and how to generate a bar code using a bar co...
I would like to create 2 HTTP requests on the same connection (HTTP persistent connection).
I'm using HttpWebRequest:
WebRequest request = HttpWebRequest.Create("http://localhost:14890/Service1/3");
WebResponse response = request.GetResponse();
byte[] buffer = new byte[1024];
int x = response.GetRespons...
Can anyone help me achieve picking using the Tao framework (or OpenTK) ?
...
Hi.
Consider the following C# code:
Decimal number = new decimal(8.0549);
Decimal rounded = Math.Round(number, 2);
Console.WriteLine("rounded value: {0}", rounded);
will produce the output: 8.05
Math.Round's algoritm only checks the next digit beyond the decimals number taken as parameter.
I need a algoritm that checks all the d...
I have a TreeView which uses HierarchicalDataTemplate to generate its items and i want to have a context menu on items(markup below). The problem is that the menu is showing but when i click on any item nothing happens. I use MVVM so menu is bound to Commands. But i have another menu on the treeview itself and it works perfectly. How can...
Hi everyone,
I write a one POS system. I want to print on continuous paper but I don't figure out how I can accomplish this.
I use the .net (C#). I try with crystal report as well as System.drawing classes.
Any idea will be helpful for me...
...
I see a lot of questions on the topic of network programming. Despite all the questions and answers I just do not know which way is best to start. Is it better to start from the lowest level, or immediately to work in .NET C #, without going into details below abstraction? Is it better to go with Winsock or BSD Socket programming in Linu...
Dear all,
Im reading about Linq , and i came across this paragraph:
"In fact, when programming with .NET 3.5/C# 2008, you can (and will) certainly make direct use of ADO.NET, the XML namespaces, reflection services, and the various collection types. However, the basic problem is that each of these APIs is an island unto itself, which o...
Are there any free alternatives to using "Microsoft Excel 12.0 Object Library" component in the application? It does the job, but it's very slow. I know there are commercial third-party tools, and wondering if there's anything fast, but freeware to accomplish the task.
...
I have a large list of error messages that my biz code can return based on what's entered. The list may end up with more than a thousand.
I'd like to just enum these all out, using the [Description("")] attribute to record the friendly message.
Something like:
public enum ErrorMessage
{
[Description("A first name is required for...
In C# how does a declaration differ from a definition, i.e.:
A class declaration vs a class definition
A variable declaration vs definition
A method parameter declaration vs definition
In C++, this was rather obvious, but in C# from what I can tell from the ECMA standard and MSDN is that everything is a declaration and where the word...
Here's a screenshot of the error:
The error itself is:
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
Going to the app.config file of that same project I can find:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrin...