.net

RegEx pattern in .VB

I have a string and need a RegEx Pattern for this, so I can extract only the date and the numbers from the tags: Dim a as string= "<table id=table-1 > <tbody> <td align=right> <h2 id=date-one>12.09.2010</h2> </td> </tr> </tbody></table> <table id=table-2 border=0 cellspacing=0 cellpadding=0><tbody><tr><td align=center valign=middle><h3...

What are the standard ways to put a crisp partial border around a WPF element?

If I have a menu bar in WPF and I set its Border to be black and have thickness 1, I get a crsip 1 pixel border all the way around the menu bar, instead of just a nice crisp line at the bottom. Similarly for a status bar. How can I get a nice crisp boundary around just part of a WPF element like a menu bar or status bar? Having crisp 1 ...

SmtpException (Syntactically invalid EHLO argument)

Hello, We just changed our .net mailSettings to target a new smtp server but we experience the following issue when trying to send e-mail "Syntax error in parameters or arguments. The server response was: Syntactically invalid EHLO argument(s)" I assume our parameters (userName, host, password and port) are correct as if we deploy the ...

Thousand of messages in Event Viewer

I have a web service running in IIS, there are no errors being thrown and everything works great. BUT I notice that there are thousands of Messages in the Event viewer. Every time I send a request to the web service, a few of this messages are added to the Event viewer. Even Type = Information Event ID = 0 Category = None Source = /LM/W...

Silverlight - How to navigate from a User Control to a normal page?

If I do this inside a User Control: NavigationService.Navigate(new Uri("/Alliance.xaml", UriKind.Relative)); it says this error: An object reference is required for the non-static field, method, or property 'System.Windows.Navigation.NavigationService.Navigate(System.Uri)' Thank you ...

Find specific object in list in object in a LINQ query

Let me explain using this code sample: var commands1 = new List<int> { 1 }; var lessons = new List<lesson> { new lesson { hours = new List<hour> { new hour { period = 1 } } } }; List<command> commands2 { get { return ( from o in commands1 select new command { ...

Disable Type Hinting in WCF JSON Services

I have what should be a relatively simple question that I can't seem to find an answer for. When WCF performs its serialization of objects, it automatically applies Type Hinting. For Json services, this results in an extra field on each complex object called __type. An object defined as: [DataContract] public class SomeObject { [Da...

Change the value of every cell in a DataTable column

I have a System.Data.DataTable which I'm binding to a GridView. If the user doesn't have a certain security role, I want to replace the data in certain columns with an "X". Can I do this without looping through all of the rows? ...

Are nested Areas possible in ASP.NET MVC 2?

I would like to create a project structure with nested areas. For instance I have a "Home" area and underneath this I would like the "News" area that handles it's own route registration and will properly find views when a route points to a controller in the "News" area. By changing the "News" area name to be "Home/News" instead of simp...

PostSharp - What am I doing Wrong?

Hello, I have a project Company.Business that I'm trying to target with PostSharp to wrap my business layer. In the project Company.AOP, I have a method boundary aspect to use EL logging application block as such: [Serializable] public class MethodExcecutionAttribute : OnMethodBoundaryAspect { public override void OnEntry(MethodEx...

DataGrid Excessive Databinding Property Get Calls

We have a data grid on a window that is bound to a collection of objects. We are having very bad performance on this window; it can take up to 20 seconds to load, and then 5-7 seconds each time you 'scroll' the data grid. This is with a total of 12 items so far. When we investigated, it seemed that the primary cause of the slowdown w...

Login into Sonicwall VPN through a .NET application

I am currently trying to access a sonicwall VPN, inside of a .NET application. We have all the necessary credentials inside of our database, but I can't find a way to call the sonicwall inside a .NET application to start it. Does sonicwall have an api of any sort? Or does .NET have a way to access the sonicwall vpn? I have seen Remote A...

From MVC to MVVC

I don't want to store my domain model classes in the same assembly as my web platform. The Models folder in the project structure is therefore useless to me. I've however just finished the Music Store Tutorial and noticed how they create a "ViewModels" folder which makes lots of sense to me. Does it make sense to just treat the Models...

How can I set a min value in .Net without using a lock?

I have multiple threads accessing variables. I know how to write spinlocks and use the Threading.Interlocked methods to increment etc. variables. However, I want to perform the equivalent of: a = Math.Min(a, b) or a = a | 10 ... but without using a critical section. Is this possible? I know the 2nd line is possible in assembler, but ...

Connect to SQL Server from Microcontroller (Arduino or Fez with .Net Micro Framework)

I'm looking for examples, tutorials, or just "this+this+this should work" for reading from and writing to a SQL server (2008) from a microcontroller such as the Arduino board. I've also looked at (and will probably go with) devices with the .Net Micro Framework such as the Fez Cobra. The Micro Framework does not include ADO. I'm sure t...

What CMS should I learn? .Net ones only

Hi I am thinking of learning a CMS. I am not sure which one will be the best to learn. I seen quite a few job posting asking for a website with CMS capabilities(so it seems something that would be good to know). CMS on the surface seem to be easy to use but in my mind this seems to quickly change when I start thinking of sites that n...

Does Marking Objects As Serializable Incur Overhead?

If I add the [Serializable] attribute to a class, does this introduce any overhead? How about if the class is never used in any serialization operations? ...

What's the reason the static analysis wasn't made available to VS 2010 Pro?

Is it so that the regular developers focus on writing their Contracts locally and then submit them to be analysed globally? Or is there a way to get something comparable to this experience? Maybe as a separate download? Also if a library have Contracts, then would the intellisense tooltips would include the Contracts no matter what ver...

Silverlight Application Hosting Requirements

Hi there, I want to build a silverlight web application that could installed on a user's computer. So any hosting requirements would be subject to whatever configuration the user has. What are there requirements to host a silverlight application? I need the same question answered for Flash and WPF. Can any OS be used? Is it required...

setting ToolStripSplitButton.DropDownButtonWidth to 0

I want to use ToolStripSplitButton as a button only (no drop down menu) in my StatusStrip. For this reason i want to not display the little arrow, but i can't do this. Tried do this with setting ToolStripSplitButton.DropDownButtonWidth to 0, and it works successfull in windows 7 but not in windows xp. how to get rid of the little arro...