.net

What is Event in C#?

in c# what is Event? Is it similar to ActionScript Event ? Is it different? In what? ...

[NET] Reflection

using : Dim a As [Assembly] = [Assembly].LoadFile("C:\test.exe") Dim testTP As Type testTP = a.GetType("SplashScreen", True, True) obj1 = Activator.CreateInstance(testTP) obj1.show() my prog made reflection to test.exe > SplashScreen loaded , also obj1 filled when SplashScreen disposed -> MainForm loaded > the obj1 isnothing...

.Net Xml Serialize - XSD Definition for Multiple Namespaces

The following XML was generated by serializing .Net objects: <?xml version="1.0" encoding="utf-8"?> <Request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://EPS.WebServices/WebServiceSchema" > <Method xmlns="http://EPS.Library/RequestSchema"&gt;PackPlacementUpdate&lt;/Me...

Richtextbox SelectionFont.Size when multiple sizes are selected

Hi, When a selection in WindowsForms RichTextbox uses two or more different font sizes (eg. you select text with font size 9 and some other text with font size 16 in the same selection), SelectionFont.Size always returns 13. Is there any way to detect that two different sizes are selected? ...

How to Get a Specific Column Value from a DataTable?

I have a datatable. I need to fetch a certain column value based on the user input. For example, lets say the datatable has two columns CountryID and CountryName. I need to find CountryID in the datatable based on the user input country name. I could just open a connection with DB and run the query select countryID from Country where co...

c# .net change label text

Hello for I trying to use this code but for some reason it doesn't work. Really need help with this. The problem is that the label doesn't change name from "label" when I enter the site. <asp:Label ID="Label1" runat="server" Text="label"></asp:Label> <% Label1.Text = "test"; if (Request.QueryString["ID"] != null) { ...

Why did the aspnet_client folder come back in ASP.NET 4?

I recently upgraded my MVC 1 project (ASP.NET 3.5) to MVC 2 (ASP.NET 4). I noticed there is now a folder "aspnet_client\system_web\4_0_30319" under the site root. This folder is empty... I'm just wondering if anyone knows why it was created. I remember the aspnet_client folder from the days of .NET 1.1, but I thought it was obsoleted wh...

Some questions about the .NET Entity Framework and Stored Procedures

Hey everyone, I had a couple of questions relating to the .NET Entity Framework and using stored procedures. Here goes: I know that we can right click a stored procedure and choose Function Import to be able to use with code. Is there a way to do this for many stored procedures at once? When doing a Function Import, I can create a ne...

How do I get a .NET Bitmap and an OpenCV image to point to the same chunk of memory?

How do I get a .NET Bitmap and an OpenCV image to point to the same chunk of memory? I know that I can copy from one to the other, but I would prefer that they just point to the same pixels. Bonus points for a solution using Emgu. ...

RegLoadAppKey working fine on 32-bit OS, failing on 64-bit OS, even if both processes are 32-bit

I'm using .NET 4 and the new RegistryKey.FromHandle call so I can take the hKey I get from opening a software registry file with RegLoadAppKey and operate on it with the existing managed API. I thought at first it was just a matter of a busted DllImport and my call had an invalid type in the params or a missing MarshalAs or whatever, bu...

What are some examples of MemberBinding linq expressions?

There are three possibilities, but I can't find examples: System.Linq.Expressions.MemberAssignment System.Linq.Expressions.MemberListBinding System.Linq.Expressions.MemberMemberBinding I want to write some unit tests to see if I can handle them, but I don't know how to write them except for the first one, which seems to be new Foo { ...

Efficiently Combine MatchCollections in .Net Regex

In the simplified example, there are 2 Regular Expressions, one case sensitive, the other not. The idea would be to efficiently create an IEnumerable collection (see "combined" below) combining the results. string test = "abcABC"; string regex = "(?<grpa>a)|(?<grpb>b)|(?<grpc>c)]"; Regex regNoCase = new Regex(regex, RegexOptions.Ignore...

method without access modifier

Ok this is bugging me.. I know I've read it somewhere and google isn't helping. What is the accessibility level of a method that does not specify an access modifier? void Foo() { //code } I want to say internal but I'm not 100% sure. ...

Why is this giving me 2 different sets of timezones?

Edit I believe this is a issue with I am using windows 7 and my server is windows 2008. I think windows 2008 uses still GMT. So how could I get around this issue. Like I want to deal in UTC but I want to have the default selected item to be "Coordinated Universal Time" what is not in the gmt list but in the UTC list. So I am not sure ...

C# Bug or Brain Teaser? Cast working only with Coalesce (??) Operator

This is very strange, maybe someone can explain what's happening, or this is a bug (though I tend to think that this is probably just something intricate about C#). The following code throws the error "Cannot implicitly convert type 'uint?' to 'uint'.": public void Test(UInt32? p) { UInt32 x = p; } However, this code works witho...

How to add event listeners in C#?

How to add event listeners in C#? ...

WPF binding behaviour different when bound property is declared as interface vs class type?

This started with weird behaviour that I thought was tied to my implementation of ToString(), and I asked this question: http://stackoverflow.com/questions/2916068/why-wont-wpf-databindings-show-text-when-tostring-has-a-collaborating-object It turns out to have nothing to do with collaborators and is reproducible. When I bind Label.Con...

"Object reference not set to an instance of an object": why can't .NET show more details?

"Object reference not set to an instance of an object" Why does the exception not also show the name of the object reference field, or at least its type? This is probably one of the most common run-time errors in .NET. Although the System.Exception has a stack trace, there are no other helpful details. Over the course of a year I spen...

Any good informational blogs or websites devoted to .Net developers for OAuth?

I need a site that does a decent walkthrough on getting one of the OAuth projects for .Net running for my own company's use. Any pointers to documentation and related sample code would be much appreciated. I can already find DevDefined, Magex, and DotNetOpenAuth. I just don't find anyone writing up their own use of these projects. ...

Is that the way to open old project in VS2008 without using any .NET framework ?

Hi I've got a question about opening the old project in VS2008. If I have old c++ project(implement in VS6.0), and now I'd like to open it in VS2008 but I don't want to use .NET library because the application will be installed on the machine that has no any .NET framework (and I don't want to install any .NET to that machine). So is ...