.net

Graphics DrawString with controlled Word Wrap

Basically my issue is that I need to word wrap a string when I want to. Not when .NET wants to. I understand that the DrawString method will automatically word wrap if I give it a rectangle to draw within. I need to control when it does word wrap it. So lets say my string I want to draw is Testing 1234. And I want to draw text on a new l...

Problem with SerialPort in a C# application

I made an application in C# which sends 11 byte of data to a serial port using: port = new SerialPort("COM1"); port.BaudRate = 9600; port.DataBits = 8; port.Parity = Parity.None; port.StopBits = StopBits.One; port.ReadTimeout = 1000; port.WriteTimeout = ...

how to write this into linq to object query?

from a list, which got 3 attributes I want to return a new list of that class where attribut1 recurrence in the list equals X for an example this; 1,a,b 1,c,d 1,e,f 2,a,b 2,c,d 3,a,b 3,c,d 3,e,f 4,a,b 5,a,b 5,c,d 5,e,f 6,a,b 6,e,f where X = 1 would return that list 4,a,b where X = 2 would return tha...

binding html radio buttons

I have a list of input type radio buttons in formview (edit mode) and i want to bind data from datasource that is assigned to formview. Can i bind html radio buttons using sql datasource? ...

.NET: Are there any differences between InvariantCulture and en-US?

Given the following two cultures: CultureInfo c1 = InvariantCulture; CultureInfo c2 = new CultureInfo("en-US"); and i were to examine every piece of information specific to both cultures, e.g.: c1.DateTimeInfo.ShortDatePattern; c2.DateTimeInfo.ShortDatePattern; c1.DateTimeInfo.LongDatePattern; c2.DateTimeInfo.LongDatePattern; c1.Nu...

Is it safe to allow two threads to edit different properties of the same object at the same time?

I am writing a cataloging application that parses through and extracts information from files and stores the information from each file in an object instance. In addition to the data extracted from the file the objects also have additional meta data properties (author, tags, notes, etc..) which later get stored in a separate XML file. E...

Is there anything like .NET's NotImplementedException in Java?

Is there anything like .net's NotImplementedException in java? ...

Re-using DataSets in .net

Is it a good idea to re-use a dataset in .net? What I mean is...I have the following code which loops a gridview For Each row in GridView ds = New DataSet ds.ReadXML(GetStream(row.Field)) ... export the dataset Next What I am doing in the loop is creating a new instance of the DataSet. Can't I just call ds.Clear() and then reuse...

what are aliases in ldap

What are aliases in ldap (referenced for example here php.net/ldap) Are they pointers to other objects in the system not directly under the object where the alias is found? ...

Programmatically access All Users Start Menu

Does anyone know how to programmatically access the "All Users" Startup Menu? In XP, located here: C:\Documents and Settings\All Users\Start Menu\Programs\Startup And in Windows 7, located here: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup Specifically, I've got a Setup and Deployment project, and I'd like to put a...

Chart Control Inside SSRS ReportViewer is Viewable From Localhost But Not Internet

A project I own was just moved from an older server to a new one, and in the process of moving the web folder, re-deploying the SSRS reports, restoring the database, configuring IIS, etc... I have lost the ability to view the Microsoft Chart Controls that are embedded in the SSRS reports, that are then displayed by a Microsoft.ReportView...

Intercept file access on a network share in .NET

I am looking for a way to possibly intercept the point that a file is being accessed on a network share. Specifically before it is determined whether the user has access to the file or not. The goal will be to grant access to that file if the file request is coming from a specific process and that user currently does not have access. ...

How to start a service after installing it?

Possible Duplicate: Automatically start a Windows Service on install I have a Windows service that I've flagged for automatic start-up in its installer. I use a Setup Project to install the service, which works fine, but I can't figure out how to get it to automatically start the service. Is there a way I can tell either the ...

Properties.Settings.Save() only saves on first call

I have a DataGridView populated with a BindingList. This list gets saved into the Settings file. It saves and loads correctly.. but will only save the first time I call Properties.Settings.Save(). After that, calling Save() will do nothing. I have verified that Save() is being called, and that at the time it's called the BindingList ...

Draw a shape in GDI+ that overlays opaque pixels with transparency

I have a mask bitmap (bmpMask) that I am drawing onto a destination bitmap (bmpDest). Both bitmaps have alpha channels but are already full of opaque content. What I want to do is produce transparent areas using GDI+ 'Draw...' methods on bmpMask so that bmpDest shows through when I draw bmpMask over it. Of course gMask.DrawLine(Pens.T...

C#: How to prevent two instances of an application from doing the same thing at the same time?

If you have two threads within an application, and you don't want them to run a certain piece of code simultaneously, you can just put a lock around the piece of code, like this: lock (someObject) { // ... some code } But how do you do the same thing across separate processes? I thought this is what you use a "global mutex" for, s...

NHibernate command_timeout setting from Web.config

We have a couple of long running back-end processes that take longer than the default 30 seconds. Our NHibernate version is 2.0.1.4000 and Spring.NET is 1.2.0.20313. NHibernate is configured through Spring.NET this way: <object id="SessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate20"> <p...

CLR Profiler with WCF doesn't work for specific service

Hello, I need to profile a WCF service, but I get the message "Waiting for service to start common language runtime", it only occurs with this particular service; when I tried with other WCF services, it works fine. I was wondering if I should configure something in the wcf to allow the profile. Both services run with the same account(ad...

2D game programming tutorials in C#

I want to learn about programming 2D games in C#. What are the best tutorials that are beginner oriented, written for C#, and preferably use GDI+ (or something equally simple)? I am relying on the experience this community has to direct me towards the best. ...

How to make C# web service produce soapenv namespace instead of soap?

Is there a way to make a C#/.NET web service which normally produces XML like this <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; <soap:Header> <DHeader xmlns="http://www.abc.com" /> </soap:Header> <soap:Body...