.net

How to encrypt connection string in SubSonic 3.0

I use SubSonic v.3 for my data access and I want to know how can I encryption my connection string in App.config used by SubSonic. ...

How to raise PropertyChanged event without using string name

It would be good to have ability to raise 'PropertyChanged' event without explicit specifying the name of changed property. I would like to do something like this: public string MyString { get { return _myString; } set { ChangePropertyAndNotify<string>(val=>_myString=val, value); } ...

My code is very inneficient, mind taking a look for this simple Linq usage?

I have the following method that is supposed to parse information from an XML response and return a collection of users. I've opted into creating a Friend class and returning a List to the calling method. Here's what I have so far, but I noticed that the ids.ToList().Count method parses every single id element to a List, then does it a...

I want to check the Count of an IEnumerable but it's very inneficient. Any help?

Special thanks to Rex M for this bit of wisdom: public IEnumerable<Friend> FindFriends() { //Many thanks to Rex-M for his help with this one. //http://stackoverflow.com/users/67/rex-m return doc.Descendants("user").Select(user => new Friend { ID = user.Elem...

5 ways for equality check in .net .. why? and which to use?

Hello, While learning .net (by c#) i found 5 ways for checking equality between objects. The ReferenceEquals() method. The virtual Equals() method. (System.Object) The static Equals() method. The Equals method from IEquatable interface. The comparison operator == . My question is : Why there are so many Equals() method along with ...

Selecting from an accordion control (ajaxtoolkit)

I would like to have an accordion control that I can select from. The best way I can describe this is with a picture- http://lh5.ggpht.com/_4AHxBGhAhe0/TDQEC_1RXtI/AAAAAAAABMk/AE84nPTeyrg/s800/Untitled.gif (cant post img) I have this built, but it does not work... It is within a wizard(step). Upon moving on from this step I want to sto...

Are conditions for raising "potentially dangerous Request.Form value" errors dependent on .NET configuration and version?

I'm testing a Tiny_MCE plugin for BlogEngine.NET extension I wrote earlier and I keep receiving the following error message whenever I use my own extension or the extremely popular SyntaxHighlighter extension which both have similar behaviors and both implement Tiny_MCE plugins: Url : 'http://localhost/admin/Pages/Add_entry.aspx' ...

log4net AdoNetAppender problem

I'm using log4net and i configured my xml file to log into database with AdoNetAppender and evrything seems to work properly when i create the applciation and configure evrything. And i can succesfuly log to the database. But when i change the message in my code then it stops logging to the database. Here is my configuration <appender ...

WPF PathGeometry update is _SLOW_

In a WPF UI I have nodes connected by bezier paths, like so: When the user drags a node around, the connecting paths need to be updated in real-time. However, I've noticed some slowdown (especially if one node is connected to many others, or multiple nodes are being dragged at once). I profiled it, and the main problem appears to be h...

Which should i use for empty string and why?

Possible Duplicate: What is the difference between String.Empty and string variableName = ""; or string variableName = string.Empty; ...

infragistic ultragrid C# winform

I would like to select multiple rows in the ultragrid WITHOUT holding the CTRL key. is it possible? i have rowSelecteType = extended. ...

In the .NET framework, why are there PointF (float) and no "PointD" (double)?

Can anyone explain why, in the .NET framework, there are PointF structures (using the single-precision float type) and no "PointD" (using the double-precision double type)? Did they establish that such precision would never make sense in the System.Drawing namespace? Is there any other reason? ...

How to specify custom SoapAction for WCF

Hi, I am creating a WCF service which will be called from another service. In the WSDL soapaction is appearing as follows <soap12:operation soapAction="http://tempuri.org/ISubscriptionEvents/MyMethod" style="document" /> I want it to be <soap12:operation soapAction="http://www.TextXYZ.com/FUNC/1/0/action/MyMethod" style="document" /...

Passing client created object to server .net remoting

How can I pass my client-side object to my server object in .net remoting? This is how I'm doing my test. On my class library: public interface IServer { bool SubmitMessage( ISampleClass sample ); } [Serializable] public Server : MarshalByRefObject , IServer { Public Server() { } public bool SubmitMessage( ISampleCla...

Is WCF RoutingService transactional?

Hello everyone, In WCF4 we a provided with a great feature - routing services. MSMQ4 supports remote transactional read. So now building simple publish-subscribe on WCF seems to be a piece of cake. But I get one doubt. Does the System.ServiceModel.Routing.RoutingService, which implements routing stuff for messages, work in a transaction...

Release com objects at application crash

Is there a way to release com objects at application crash? I have the following code: public class Application : IDisposable { private bool disposed = false; private object realApplication; public void Dispose() { Dispose(true); } private void Dispose(bool disposing) { if (!disposed) {...

Why "decimal" is not a valid attribute parameter type?

It is really unbelievable but real. This code will not work: [AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)] public class Range : Attribute { public decimal Max { get; set; } public decimal Min { get; set; } } public class Item { [Range(Min=0m,Max=1000m)] //compile error:'Min' is not a valid named attrib...

.Net what new Regex(@"[ ]{2,}", options) means

What's happening in this code snippet ? RegexOptions options = RegexOptions.None; Regex regex = new Regex(@"[ ]{2,}", options); string outStr = regex.Replace(inStr, @" "); What I am looking for is to replace any sequences of "white" spaces ( including TAB, CR, LF ) with a single space. ...

Adding multiple content databases to Sharepoint

I am trying to create a new web application in Web service. I am using this code to do this. SPWebApplicationBuilder webAppBuilder = new SPWebApplicationBuilder(SPFarm.Local); webAppBuilder.Port = port; webAppBuilder.RootDirectory = new System.IO.DirectoryInfo(@"C:\Inetpub\wwwroot\wss\VirtualDirectories\" + port)...

Error enumerating users in LDAP

I am getting the following error when trying to enumerate users in LDAP(Lightweight Directory Access Protocol). I have verified my connection string to the server (LDAP://domainname). The server is of course online and operational. Error Message: Server is not operational Stack Trace [2264] System.Transactions Critical: 0 : [2264] <T...