.net

How do I get 3 lines of text from a paragraph

I'm trying to create an "snippet" from a paragraph. I have a long paragraph of text with a word hilighted in the middle. I want to get the line containing the word before that line and the line after that line. I have the following piece of information: The text (in a string) The lines are deliminated by a NEWLINE character \n I have ...

ODP.NET Procedure Compilation

When I try to execute a create procedure using ODP.NET I get back ORA-24344: success with compilation error. However, when I run the same statement in SQL Developer it compiles successfully. Does anyone know what I need to change to get my procedure to compile? Is it a character set issue? I am using Oracle 10g Express, .NET 3.5 SP 1...

Generics in custom configuration sections

I tried making a custom configuration class that went on like this: WatcherServiceInfoSection<TWatcherServiceDetailElement> where TWatcherServiceDetailElement is a ConfigurationElement inside it. Now when I call the type in the ConfigSections area of AppConfig I get the error: An error occurred creating the configuration section han...

How to cache method results in .Net

Using webmethods, caching the results is pretty straight forward using "CacheDuration" attribute. Is there a similar "easy" way to cache non-webmethod outputs (or static methods) based on the parameters? I would appreciate any help. Thanks in advance! ...

Is it a good idea to use .Net for commercial software?

I was playing around with .Net reflector today and realized that Miicrosoft's entire Expression suite is written in .Net. As a result I was pretty much able to see the underlying code for expression. This makes it far easier than binary to break copy protection. I think that that's a big deal. Is it generally recommended to make commerci...

Recommended (remote) backup technique for SQL Compact?

Hello. Is there a generally recommended approach to backing up an SQL CE/SQLite database over the Internet? The client source is .NET/Windows based, the backup destination runs Ubuntu. I am using a small SQL CE database and have been trying to figure out the most reasonable approach to doing this. The file size (in terms of transfer ti...

Automate Testing on future only items business rules

I currently have a business object with a validation business rule, which is it can only be created for the future, tomorrow onwards, and I cannot create new items for today. I have a process, which runs the non-future business objects through some steps.. Because I have to set things up today, and test tomorrow, and when it fails, I c...

Using attributes to cache a method's return results in c#

In webmethods, it is very simple to implement caching by annotating [WebMethod(CacheDuration...] attribute. Can we create something similar for non-webmethods, such as Static methods? Any help/tip is appreciated. Thanks in advance. ...

SQL Server 2008 update one column with a value based on number words in other

Columns Words, WordsCount For each value of Words "x y z" update wordscount with 3 , "a b" with 2, "a b c d" with 4 and etc... How can I do it with/without .Net program ? ...

Web Performance testing using VS2010 "Testing a file download"

Hi All, I am trying out the VS 2010 testing tools for the first time. And I tried recording a web performance test and my actions had a file download implemented as in the KB article here http://support.microsoft.com/kb/812406 by streaming chunks of 10000 bytes. However my test is failing at the download saying "The response stream has...

Can extension methods be applied to interfaces?

Hi, Is it possible to apply an extension method to an interface? (C# question) That is for example to achieve the following: create an ITopology interface create an extension method for this interface (e.g. public static int CountNodes(this ITopology topologyIf) ) then when creating a class (e.g. MyGraph) which implements ITopology,...

.NET framework 4 total application deployment size

After watching in horror as the .NET framework 3.5 SP1 bloated to whopping 231 MB I was amazed to see that .NET Framework 4 Full (x86) is only 35 MB and client profile just 29 MB. My question is if .NET Framework 4 is in any way dependent on previous versions of the framework being installed on the client machine or if my users will hav...

Cast errors with IXmlSerializable

I am trying to use the IXmlSerializable interface to deserialize an Object (I am using it because I need specific control over what gets deserialized and what does not. See my previous question for more information). However, I'm stumped as to the error message I get. Below is the error message I get (I have changed some names for clarit...

Does .Net use Device Dependent or Device Independent Bitmaps?

When loading an image into memory, does .Net use DDB, DIB, or something else entirely? If possible, please cite your sources. I'm wondering because we currently have a classic ASP application that is using a 3rd party component to load images that is occasionally creating a “Not enough storage is available to process this command.” erro...

Can SOTI's MobiControl software interfere with an ASP.Net web service?

We have a set of WinMo (5.0) devices running a .NET CF application that talks to an ASP.Net web service running on a server. The devices connect to the network either via ActiveSync through a networked PC or directly to the network via an Ethernet dongle. In our development environment, the communication between devices and web service...

Representing C#3 code as an Abstract Syntax Tree in XML

I was wondering if there is something similar to GCC_XML for C#3; basically a way to represent a program's entire syntactic structure in XML. Once the representation is created, I was hoping to parse it into an XDocument and interpret or query it from there. Are there tools out there for this? ...

i need tips and advices while migrating code from vb6 to .net with visual studio 2010

i want to migrate one of the application from vb6 to .net with visual studio 2010.At present the application is windows based application. i want to make web application. i guess i have to rewrite the code in .net. could you please advice me while i rewrite the code in .net. ...

how to unit test AOP?

i'm using Unity to do AOP, could someone give me some idea how to unit test them? ...

Membership - get user email

I am using ASP.Net MVC2 with the default membership/profile/role providers, I'd like to access the user email in my ForgotPassword Action to email a new password to the user, but so far I've only been able to get the username (User.Identity.Name). Am I missing something here? ...

send private message to user

Hi! How I can send an private message to user using Facebook Toolkit?? ...