.net

In a Console App, is there a way to detect when StandardInput is available?

I wanna build a console app that may stop and prompt for some input, under some conditions. But I want to prompt only if input will be available. Is there a way to know if Stdin is connected to anything? I think powershell does this, and I'd like to do something similar. Powershell detects when it is run interactively, and prompts...

Typed Dataset with null values to XML

When a typed DataSet is written to XML using ds.GetXml the columns with null values are removed from the XML. I know this is because the schema is not written etc. but is there a way to override this without having to parse through the DataSet and convert all database nulls to empty string before writing the XML? EDIT: additional info...

Please suggest 3D Report Creation tool that have a good look and feel?

I want to create 3D reports which have a good look and feel. I am using VS 2008 and SQL server 2008. Is there any way of creating 3D or 4D reports in SQL server 2008 or can I use the crystal reports package that is bundled with .NET? ...

method overloading and polymorphism

I'm writing a .NET web application in which administrators can customize the various data entry forms presented to their users. There are about half a dozen different field types that admins can create and customize (i.e. text, numeric, dropdown, file upload). All fields share a set of base attributes/behaviors (is the field required? ...

What might be causing String.Format to move characters around unexpectedly?

So I have this code: /* variables already initialized: int numFlips int numAggrFlips double pctAggrFlips */ String flipsMessage = String.Format( "Flips: {0} / Aggr: {1} ({2})", numFlips, numAggrFlips, pctAggrFlips.ToString("0.0%") ); For some mysterious reason, the output ends up being the following string: (Flip...

Referencing Web.Config Settings in one place

I have an asp.net web application that is using a MembershipProvider and RolesProvider that I wrote to use our eDirectory ldap servers. Here are my providers now: <membership defaultProvider="EDirectoryMembershipProvider"> <providers> <clear/> <add name="EDirectoryMembershipProvider" type="EDirectoryMembershipProvider" ...

.NET WebBrowser Control as User Interface

First a few definitions to keep things clear. User: A live person, using the software Client: A company that is paying for a customized version of our software for their users. We currently have a few applications that are going to require significant changes in the user interface based on which client the user belongs to. We ...

How can I get ConfigurationManager to load application settings from multiple files?

I'm writing applications that interoperate with a third-party application. This application exposes an API to developers via methods in a DLL. Some time ago, the vendor of this app started integrating their own .NET components into their program, and when they did, they decided that their components should use the ConfigurationManager ...

how to create an animated gif in .net

Hi, Does anyone know how to create an animated gif using c#? Ideally I would have some control over the color reduction used. Is using imagemagick (as an external started process) the best choice? thanks! ...

Why can't this reference be resolved?

I updated my Sharp-Architecture libraries to the newest version and all of a sudden I'm getting unable to resolve errors - specifically with NHibernate Validators. I am not quite sure why though, here is what my test assembly looks like in reflector: But the NHibernate.Validator library with the exact same version number/public key...

What does "=>" mean?

Forgive me if this screams newbie but what does "=>" mean in c#? I was at a presentation last week and this operator (I think) was used in the context of ORM. I wasn't really paying attention to the specifics of syntax until I went back to my notes. I'm a vb.net guy trying to do more in C#. I already tried Google and some of my referenc...

Cleanest way to parse this pattern of strings?

I have music file names like: Gorillaz (2001) Gorillaz (7th State Mix) (2002) Gorillaz (2001) (Featuring Travis) Gorillaz (1Mix) (2003) Gorillaz (1000) (2001) How do I parse the year in the cleanest, easiest way? Right now I am parsing them by finding each '(' and then making sure the character count between the ()s are 4 and first c...

SubSonic 3.0.0.3 Calling Stored Procedure Issue

Hi, I have updated the subsonic reference from 3.0.0.0 to 3.0.0.3, when I try to execute a stored procedure then I get a following error Implicit conversion from data type sql_variant to varchar is not allowed. Use the CONVERT function to run this query. I am calling the store procedure as follows db.GetAllLoanApplications(orderBy, ...

.Net: Is there a better way to check object's property for null or empty string?

I'm using FileHelper to generate object's property. Here is an example of one property: <FieldOptional(), _ FieldTrim(TrimMode.Both)> _ <FieldNullValue(GetType(String), " ")> _ Public StoreNo As String As you can see the StoreNo will either have a value or " ", one of the business policy is to check if the StoreNo is empty or nothin...

How to debug .NET Windows Service OnStart method?

I have code written in .net that only fails when installed as a windows service. The failure doesn't allow the service to even start. I can't figure out how I can step into the OnStart method. http://msdn.microsoft.com/en-us/library/7a50syb3%28VS.80%29.aspx gives a tantalizing clue: Attaching to the service's process allows you to...

Sending several ExecuteNonQuery() to same database, which transaction type and error checking to use? (.NET)

I have an asp.net web site which will send several ExecuteNonQuery() statements (stored proc) to the same database (Sql server 2005). MSDTC service is turned off on both web and database servers. These statements need to run all successfully, all or none. So I need to wrap them in transaction. Is the best way to use SQLTranscation? Atta...

Can I stop an IIS?

In a .NET windows application to to modify a remote machine config file that is used by an ASP.NET application. However, I keep getting the error: System.IO.IOException: The process cannot access the file '[file name]' because it is being used by another process. Now, this may not be the problem, but I'm figuring that if I can stop th...

Running repetative method at specified moments (windows, .net etc) (like clock)

This is not an urgent nor important question, seems more like exercise. How to run a function at a specific moment? The more precise, the better. For instance, I have a method which says time. I want to run it on XX o'clock, XX:15:00 (and preferably, 000 ms), XX:30:00.000, XX:45:00.000. Currently I have an (almost endless) loop, which...

geographic layers in mysql

I am looking for an implementation of MySql and Geographic layers (features\rasters), how does it work for you? which ORM \ dataaccess you are using? how do you write the geo-queries? as sql or in code ...

Wcf-MSMQ: letter is being delivered, but service is not called?

I have a MSMQ application using WCF's netmsmqbinding. In the default configuration, and with active directory integration enabled, everything works fine. However, when I try to turn off security (using the netmsmqbinding's binding configuration), it seems as if the messages on the queue are received, i.e. messages are being posted, beca...