Performance issues with using reflection
Duplicate How slow is Reflection (C#) What are some of the performance considerations when using reflection to iterate through properties and using attributes on properties in c#.net? ...
Duplicate How slow is Reflection (C#) What are some of the performance considerations when using reflection to iterate through properties and using attributes on properties in c#.net? ...
We have the following object int [,] oGridCells; which is only used with a fixed first index int iIndex = 5; for (int iLoop = 0; iLoop < iUpperBound; iLoop++) { //Get the value from the 2D array iValue = oGridCells[iIndex, iLoop]; //Do something with iValue } Is there a way in .NET to convert the values at a fixed first inde...
The computer is connected to measuring device via a physical COM1. I have simple form where I open a serial port, tell the device that I'm alive and occasionally the device sends data. (every some minutes) Thread _readThread = new Thread(Read); SerialPort _serialPort = new SerialPort("COM1", 9600); _serialPort.Parity = Parity.None; _ser...
How can i solve this error:"Column 'ASSET' does not belong to table ." ? i really learn it is belong this table: i want to do that: if(mydataset.hasgot(dr["asset"].tostring())) { // do something } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr_ = tbl.NewRow(); if (ds.Tabl...
NUnit and MbUnit has a RowTest attribute that allows you to sent different set of parameters into a single test. [RowTest] [Row(5, 10, 15)] [Row(3.5, 2.7, 6.2)] [Row(-5, 6, 1)] public void AddTest(double firstNumber, double secondNumber, double result) { Assert.AreEqual(result, firstNumber + secondNumber); } I used to be huge fan of...
Hello How do I only include certain dlls of the .Net framework which are used in my program along with the setup project instead of installing the whole framework? Thanks ...
Hello, I have a simple WPF application where user is able to minimize my application window. After user restores Window from minimized state I need to set focus to certain TextBox. If user before minimizing Window has not changed focus, then after restoring application everything is fine. But problem comes when user has changed focu...
In C#, is it possible to mark an overridden virtual method as final so implementers cannot override it? How would I do it? An example may make it easier to understand: class A { abstract void DoAction(); } class B : A { override void DoAction() { // Implements action in a way that it doesn't make // sense for chi...
I have a web application that uses a number of WCF Services. I deploy my web application in various environments (dev, UAT, production etc). The URL of each WCF Service is different for each environment. I am using .NET 3.5 andbasicHttpBindings The web application uses a framework to support machine-specific settings in my web.config fi...
Is there a way to access WMP10+'s playback speed controls in a dotnet app? User level information on the Playback control information ...
Hello, Imagine you have an ASP.NET based website that users have to authenticate for to get access. The user data (such as username, password and other information relevant for the website) is stored in a Microsoft Sql database. I know that it is possible to write an custom membership provider to create an own authentication method. H...
hi i am getting an error DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'image'. i use xml and asp.net <%@ Page Language="C#" MasterPageFile="ContentMasterPage.master" Debug="true"%> <%@ Import Namespace="System.Xml"%> <%@ Import Namespace="System.Xml.Xsl" %> <%@ Import Namespace="System.Xml.XPa...
I am using a UdpClient to send packets to a server. I am initializing the UdpClient upon construction of my Sender object, using the (hostname, port) constructor. When constructed in this manner, the UdpClient resolves the hostname to an IP address. Subsequent calls to the UdpClient object use the IP address. Unfortunately, if the DNS a...
I'm writing a static class for logging to be used across my developed solution. There are several components that will use it such as a console application, ASP.NET application, etc... For the logging to work, it needs to do some initial startup configuration before it can be used, and also some clean up when each application has finish...
I'm writing a WPF desktop application and have a view that needs to look like a calendar. I only need to show four weeks (fixed). Each week will have a list of items (probably represented with a ListView). I'm debating between two approaches: Using layout controls - a Grid control where each "cell" contains a ListView Using a ListVi...
Is there anyway to determine the Exceptions that can be thrown by methods in a DataSet that has been generated by VisualStudio (using the Data > Add New Data Source menu option) other than look through the generated code? ...
I have written an ASP.NET application, and in this application I log the request IP address. And I also serve different content according to different IP range. My question is, in my limited test environment, I only have 5 machines, each machine has only 1 IP address, I want to test fully about the function of my IP address based ASP.NE...
Hi, I'm trying to select the first row where the cell value starts with the same keychar the user pressed. That's the part that is giving me trouble. Here's how I'm handling the event (updated with working solution): private void dataGridView1_KeyPress(object sender, KeyPressEventArgs e) { if (Char.IsLetter(e.KeyChar)) { ...
I have recently become aware that our code has serveral implementations of a version parser (that is code to create a Version object from a version string). Thinking this was one of those times when people could not be bothered to read the docs I figured I would jump into MSDN, find the "standard" method to do this and replace the vario...
Say I have several .NET assemblies and want to sign each of them with a strong name. Is one keypair (one .snk file) enough or do I need to generate one pair for each assembly? Will I have to publish the public key of (each) keypair? ...