.net

.Net: better equiv for " " (space character)?

I am using a string builder as part of a logging process. my seperator character I am using is " ". How can I output this char in a more effective way than simply " ". For example: sb.Append(" "); Or this this the acceptable way to do this? Thanks in advance ...

Mono GetText on .NET 3.5

Hi I have a problem with my app, using gtk# and Mono/.NET 3.5 MonoDevelop (which im using) under Linux shows all strings to translation, but monodevelop on windows - shows nothing. is there a way to make it work or is any another cross-platform solution to add multi-language to it? thanks in advance ...

Test System.Net.Mail.SmtpClient settings without sending an email

Hi! At first glance my question is very similar to this one, but it is different. In my ASP.NET application user can save all settings necessary for sending an email (host, port, user name, password), and then send messages to other users using this settings whenever he wants. Please note that email isn't actually sent when user saves t...

Need help to create playlist from DB for JW Player

I'm thinking of using JW Player to show some videos. Currently I'm using this test XML file which works great. But now I need to change this with data from a database. First I thought I could output the HTML playlist directly: <div class="clearfix" id="playlist"> <div class="jw_playlist_playlist"> <div class="jw_playlist_it...

How do you clone a dictionary in .net?

I know that we should rather be using dictionaries as opposed to hashtables. I cannot find a way to clone the dictionary though. Even if casting it to ICollection which I do to get the SyncRoot, which I know is also frowned upon. I am busy changing that now. I am under the correct assumption that there is no way to implement any sort of ...

Nhibernate fires SQL commands

Hi all, when updating an entity A, NHibernate also send an SQL update command for some other entity B. A and B are not related. Just before saving entity A, the parent of entity B is loaded via a SQLQuery. Then, when accessed, B is lazy loaded (part of a collection). If I save entity A an update statement for entity B is generated as we...

Finding USB serial ports from a .NET application under Windows 7

I have an application that looks for a specific FTDI serial port with customised USB descriptors. My current code uses the example from Code Project, which searches the MSSerial_PortName WMI table under root\WMI, and pulls out extra USB information from root\CIMV2\WIN32_PnPEntity. This worked well under XP, but the application must also...

How can I open my C# application by pressing keboard key?

I created one desktop application in C# with installation version. I installed this application onto the machine. Now I want to open this application by pressing the Ctrl key of keyboard. That is when the user press the Ctrl key my installed application is open. How can I open a particular search page of my application by pressing a p...

how to call server side function from client side - asp.net

i need to call server side function from client side using javascript how can i accomplish this , thanks ...

Can I use .NET reflector to modify & recompile the code quickly?

Is it possible to use .NET reflector (or an other tool) to modify & recompile the code quickly (i.e. without dumping the source and then use VS to recompile it)? ...

Log4Net and .NET 4.0 RC

I tried to compile a project dependent on the Log4Net logging framework using .NET 4.0 RC and ran into some problems. Out of the box (just changing the target to .NET 4.0), it no longer works, a security exception is thrown. Inheritance security rules violated while overriding member: 'log4net.Util.ReadOnlyPropertiesDictionary.GetObjec...

Hosting Silverlight xap file, only white screen displayed...

I have a SL 3.0 xap I want to host in a ASP.NET website, I have access to the XAP file and I have created a HTML page to host the SL component. When I access the page all I see is a white screen where the SL component should be, SL is loaded but the component is not displayed. Any ideas why this is happening? This is the HTML code for...

Using a existing connection in a Script Component (SSIS)

I have am OLEDB Connection configured in the connection managers and I want to use it in a SCRIPT. The script needs to call a stored proc and then create buffer rows. I have added the connection to the connections available to the script and this is my code. Boolean fireagain = true; SqlConnection conn = new SqlConnection(); conn = (S...

Logic variables support for .NET

I am looking for a library/assembly that allows me to work with logical variables in F#. I want to avoid reinventing the wheel in implementing the required union-find datastructure, unification code and so on. I have found Prolog.NET, but the manual is a bit sparse. I do not want a full-fledged Prolog implementation, but only its treatm...

Synchronizing the .NET and Oracle Database Locale Environments

Where can I get a complete list that maps the .Net Culture ID (used in the CultureInfo class) to Oracle's NLS_LANGUAGE and NLS_TERRITORY parameters? Oracle's .NET Developer’s Guide makes a start at this but want a complete list so that I can set this automatically for my database session in my code. ...

Any sense to set obj = null(Nothing) in Dispose()?

Is there any sense to set custom object to null(Nothing in VB.NET) in the Dispose() method? Could this prevent memory leaks or it's useless?! Let's consider two examples: public class Foo : IDisposable { private Bar bar; // standard custom .NET object public Foo(Bar bar) { this.bar = bar; } public void Dispose(...

How to group by custom types with linq

I have this class public class Item { public Coordinate coordinate { get; set; } ... ... } With Coordinate being define like this: public class Coordinate { public Coordinate(float latitude, float longitude) { Latitude = latitude; Longitude = longitude; } ...

Instance of child class ?

How to create the instance of child class in C#? class Parent { virtual void test() { Console.writeline("this is parent"); } } class Child : Parent { override void test() { Console.writeline("this is from child"); } } public static void main() { //Which one is right below? Child ch = new Child(); Parent pa = new Parent(...

ASP.net MVC Routing: Is it good style to use QueryStrings?

Should all routes in ASP.net MVC follow a "Only slashes, no QueryString" philosophy? I'm working on a Wiki software, so I have routes like /{pageTitle} /{pageTitle/Edit /{pageTitle/History etc. for all actions, but what if I want to control the behavior of an Action? Is something like /{pageTitle}?noredirect=true okay or considere...

One word bold inside a text in winform control.

I want some way to make a given word bold(the first two characters of each item in a listbox), and nothing else, something like this: 01 car 02 house 03 market As for these three, being items in a listbox control, ALWAYS the first two characters, the rest should not be bold. Is there any practical way for doing so ? Data: Visua...