.net

Scroll bar on <asp:CheckBoxList> ?

Can anyone help me to put a vertical scroll bar for an <asp:CheckBoxList>? ...

Is there a way to put aspx files into a class library in Visual Studio 2008 .NET 3.5?

I've got a lot of pages in my site, I'm trying to think of a nice way to separate these into areas that are a little more isolated than just simple directories under my base web project. Is there a way to put my web forms into a separate class library? If so, how is it done? Thanks in advance. ...

Using events declared in Visual Basic 6.0 in a dotnet application

Hi, we are writing tests for a COM library written in VB 6.0.The problem we are facing is that, we are unable to access events declared in VB( withevents). We get exception, "object does not support set of events". How can we overcome this problem? ...

Is the .NET Micro Framework a good way to start with embedded programming?

How does the .NET Micro Framework with a dev board compare to something like an Arduino, or Nintendo DS for starting with embedded programming? ...

key press handler

I have a win form, have some controls. I want to handle all keypress in the form keypress event. Is it possible without writing keypress for all the controls? ...

Does .NET have a Dictionary implementation that is equivalent to Java's ConcurrentHashMap?

To recap for those .NET gurus who might not know the Java API: ConcurrentHashMap in Java has atomic methods (i.e. require no external locking) for common Map modification operations such as: putIfAbsent(K key, V value) remove(Object key, Object value) replace(K key, V value) It also allows iteration over the keyset without locking (i...

What's the most performant way to divide two integral values and obtain a floating point quotient in .NET?

Consider the following signature in C#: double Divide(int numerator, int denominator); Is there a performance difference between the following implementations? return (double)numerator / denominator; return numerator / (double)denominator; return (double)numerator / (double)denominator; I'm assuming that both of the above return ...

ERROR : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Hi , while connecting .net to sybase server... got this error message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified it was working sometime back. system DSN with same detatils work and data connection through vs.net also work. i am using vs.net 2005 Any suggestions? ...

Why can't I create a private static const void??

We just shifted from VB to C# and I am having some troubles..! Why can't I create a private static const void?? why is it not working? private static const void MyVoid(void void) { try { this.void void = new void(void + void); return this.void; } catch (void) { Response.Write(void); } } ...

.NET XML Serializer with Japanese chars in username

We are having a problem whenever our application makes use of the XML Serializer, when we are logged in as a user who has a username containing Japanese characters. We have prepared a sample application that tests the serializer on its own: TestClass myClass = new TestClass(); myClass.MyString = "Hello Wo...

SQLMembershipProvider - Adding membership to an existing database. Setting permissions

I am adding membership-related schemas to an existing database (lets call it myDatabase) following those instructions. As a results the number of tables, views and stored procedures are being created in myDatabase. The next step is to modify web.config for the application to use CustomizedMembershipProvider <membership defaultProvider...

Put a program in the system tray at startup

Hi I followed the commonly-linked tip for reducing an application to the system tray : http://www.developer.com/net/csharp/article.php/3336751 Now it works, but there is still a problem : my application is shown when it starts ; I want it to start directly in the systray. I tried to minimize and hide it in the Load event, but it does no...

Writing string at the same position using Console.Write in C# 2.0

Hi, I have a console application project in C# 2.0 that needs to write something to the screen in a while loop. I do not want the screen to scroll because using Console.Write or Console.Writeline method will keep displaying text on console screen incremently and thus it starts scrolling. I want to have the string written at the same po...

How can I call .NET code from Java?

I'm not looking for the usual answer like Web-services. I'm looking for a light solution to be run in the same machine. Edit: I'm looking for way in Java to call .NET methods ...

Using Server.CreateObject("ADODB.Stream") in IE7

I have a asp.net 1.1 application that uses the following code to write out a file in the response: Dim objStream As Object objStream = Server.CreateObject("ADODB.Stream") objStream.open() objStream.type = 1 objStream.loadfromfile(localfile) Response.BinaryWrite(objStream.read) This code ...

"Constraints for explicit interface implementation..."

Hi guys I can't figure out why the following wont work, any ideas?? public interface IFieldSimpleItem { } public interface IFieldNormalItem : IFieldSimpleItem { } public class Person { public virtual T Create<T>() where T : IFieldSimpleItem { return default(T); } } public class Bose : Person { ...

Why does my .NET Remoting target machine actively refuse the connection?

I am trying to establish a basic .NET Remoting communication between 2x 64bit windows machines. If Machine1 is acting as client and Machine2 as server, then everything works fine. The other way around the following exception occurs: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refus...

Using foreach (...) syntax while also incrementing an index variable inside the loop

When looking at C# code, I often see patterns like this: DataType[] items = GetSomeItems(); OtherDataType[] itemProps = new OtherDataType[items.Length]; int i = 0; foreach (DataType item in items) { // Do some stuff with item, then finally itemProps[i] = item.Prop; i++; } The for-loop iterates over the objects in items, b...

XmlSerializer and XmlElement fields

Hi, I have an xml that looks like this: <Config> <A></A> <Template><B/><C/></Template> </Config> and I would like to deserialize it in to get the <Template><B/><C/></Template> bit as a XmlElement or XmlNode. But when I try like this: public class Config { public string A; public XmlElement Template; } the Template is set...

How do I mix message encoding types (Text/MTOM) in the Request & Response of a Web Service client application using WCF (or WSE 3)?

Here is my problem. I am hitting a web service (hosted on a Java based server) that will only accept text encoded Requests, but it returns MTOM Responses. What I've found is that if I set the web service to RequireMtom, it sends an Mtom request! Unfortunately, the server chokes on an Mtom request and returns a 500 error. However, if I se...