This is a mirror of official site: http://jasper-net.blogspot.com/

Select / Deselect all checkbox in DataGrid In Silverlight

| Thursday, October 21, 2010
Introduction

In the previous article we have seen how to add a Checkbox Column In DataGrid and how to achieve multi select delete operation. In this article we will see how we can select all rows of DataGrid and delete all selected.

Creating Silverlight Project

Fire up Visual Studio 2008 and create a new Silverlight 3 Project. Name it as SelectAllRowsDataGrid.

As you see we have customized the Columns in the DataGrid.
Now we will add a CheckBox Control in the Header of first column.
I tried many ways to put a CheckBox over there, but the effective way is to create a style and assign the style to HeaderStyle of that Column.
Here is the Style in XAML.

Read more: Dot Net Spark

Posted via email from .NET Info

Virtual CD Version 10

|
sshot-2010-10-06-19-31-51_thumb.png

Overview
Virtual CD 10 is a unique app that will virtualize all off your optical media. You can virtualize CDs, DVDs, HD DVDs, and Blu-ray Discs. This is different than a just a virtual CD drive, as it creates images of your optical media, and allows you to manage it. You’ll no longer need to worry about your physical media being wrecked by scratches and constant use. Version 10 introduces a revised user interface and a lot more enhancements compared to previous versions.

Installation & Setup
There are a few things to take note of while installing Virtual CD 10. The install wizard is as basic as any software…

Read more: How-to-geek

Posted via email from .NET Info

How to Manually Repair Windows 7 Boot Loader Problems

|
If you’re having boot problems on your Windows PC, it’s often helpful to repair the MBR (Master Boot Record) to restore the Windows 7 boot loader—and you can do it easily from the Windows installation disc.

This is generally most useful if you’ve broken something and there’s a boot loader error, or if you have made the mistake of installing an older version of Windows on the same PC that already has Windows 7 which wipes out the boot loader.

Note: If your PC starts booting into Windows but fails, you should probably try using Safe Mode instead.

Boot From the Windows Install Disc
The first thing you’ll need to do is boot off the install disc, and then click through until you see the “Repair your computer” link in the lower left-hand corner.

image249.png

Read more: How-to-geek

Posted via email from .NET Info

Direct3D 10 and 11 API now natively supported by Linux via Gallium3D

|
In one fell swoop, it seems like proper, contemporary 3D gaming could be coming to a Linux distro near you.

Unlike Wine, this implementation of Direct3D under Gallium3D is an actual, native port of the DirectX APIs. There's no emulation involved -- Gallium3D just acts as a 'very thin wrapper,' allowing developers easy access to Direct3D's goodies.

Luca Barbieri, the developer behind this new code commit, has a lot to say about Direct3D versus OpenGL, which might pain some open source advocates: "Thanks to a very clean and well-though design done from scratch, the Direct3D 10/11 APIs are vastly better than OpenGL and can be supported with orders of magnitude less code and development time."

Read more: DownloadSqaud

Posted via email from .NET Info

The complete guide for switching to, or learning about, your Android phone

|
Kevin Purdy, senior editor of the Lifehacker website, has just released his Complete Android Guide. The guide costs $9 to download an EPUB version, $19.95 to buy the dead-tree version, or you can read it all for free on the Complete Guides website.

Whether you are switching from another mobile phone platform or operating system, or you've just bought your very first smartphone, this guide should prove to be very useful. Taking a brief look through the free, Wiki-esque site, it certainly seems comprehensive, with chapters covering just about everything -- and there are lots of big, easy-to-understand screenshots, too.

Read more: DownloadSquad

Posted via email from .NET Info

YouTube Time Machine helps you reminisce with YouTube videos from a certain year

|
yttm-2617.jpg

YTTM apparently stands for "YouTube Time Machine," although that's not specifically mentioned on the site. What it does is very easy to understand, though. You move a slider to a specific year between 1860 and 2010, and you get a bunch of YouTube videos related to that year. Yes, I said 1860 (that's not a typo).

Not all hits are spot-on, though. When I chose 1972, I got a video from 1970. So, I guess you could say YMMV with YTTM (sorry, couldn't help myself there). But for the most part, the hits are relevant. I think it just takes the year from the video's name on YouTube.

You can narrow your search down by categories, such as Video Games, Television, Commercials, Current Events, Sports, Movies, and Music. I'm afraid there are not many video game related videos from the 19th century, though.

Read more: DownloadSquad

Posted via email from .NET Info

Admin templates for Google Chrome make it more enterprise-friendly

|
policy.jpg

System admins generally aren't fond of rolling out new software to their users if they don't have a measure of control over what those users can and can't do with the app in question. Google knows that, and they've been working for a while now to add enterprise-friendly policy support to Chrome.

Now, Google has made policy templates available for download which provide a measure of lockdown functionality. As you can see, after importing the .ADM files into the Windows Group Policy Editor you'll be able to manage a handful of Chrome settings via a local machine policy.

Read more: DownloadSquad

Posted via email from .NET Info

ASP.net assembly loading from GAC or Bin

|
For quite a while I have been going back and forth reading msdn documentations to figure out how does an assembly gets loaded at runtime. When an assembly is in the bin of your application and also in the GAC, what gets loaded at runtime, GAC or bin? This post is a quick reference guide so that I come back to it and get the short answer rather than parse through the msdn documentation each time.

What is the answer?

The Runtime first looks in the GAC and then in the probing path of the application which includes the bin to load an assembly.

What does this imply?

If you have 2 assemblies with the same version, one in GAC and other in bin, the assembly in GAC is loaded
If you have 2 assemblies with different versions, one in GAC and other in bin, and the version to load is not specified in the config, then GAC is loaded
If you have 2 assemblies with different versions, one in GAC and other in bin, and the version to load is specified in the config, then the specified version of the assembly is loaded either from GAC or bin, wherever the runtime finds it first.

Read more: My.Ramblings

Posted via email from .NET Info

Create a Build File for a Visual Studio Solution - MsBuild Series

|
Why create a build file for a Visual Studio
Solution?
A build file automates the process of building, testing, analyzing, packaging, & deploying your project. Build files can be used to give you a single click solution to perform mundane tasks in a consistent way.
It saves you time by automating all the tedious steps necessary to prepare your project for testing or deploying. It reduces risk because you can confidently repeat the process, there's no change you will forgot to rename a file or change to release mode etc etc.

OK but How?
Creating a build file for the first time can be a little tricky so I have prepared a quick tutorial on creating a simple msbuild file for compiling your solution. Just follow the steps below and let me know if you have any issues.

1) Folder Structure

Once we start running builds of our project we need a place to store the results. We may also need extra tools for our build process and of course we need a place for our new build file.

Below is a the folder structure I will be using for this introduction. It allows us to keep all of the build files / folders out of our source tree.

Project Root:/
/Build – result of the build will be placed in here
/Source – all source code (& libraries) for the project
/Tools – collection of tools used for the build process
/build.bat – simple 'double click to build' ms dos batch file
/build.proj– our build file for msbuild, this is where we define the steps for our build process

2) Creating the Batch File

Create a new blank file called build.bat in the root directory of your project. This will be a simple ms dos batch file to kick off our build script. Simple copy the contents below into the batch file.
REM dont remove this line
"%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" /nologo build.proj  %*
Make sure you leave the first line intact, otherwise you may run into problems because of the encoding used to save the file. If you have issues with encoding then you may need to open the file using a specific encoding (850) see: http://msdn.microsoft.com/en-us/library/dxfdkfke(VS.80).aspx.

The batch file simply calls msbuild.exe and passes in our build.proj file. The %* argument passes any command line arguments supplied to the batch file into the msbuild.exe command. This allows us to specify a target at the command prompt like this: build /t:clean

4) Creating the Build File

Read more: Marks asp.net / mvc blog

Posted via email from .NET Info

Web VNC Client

|
As both dedicated and virtual hardware shifts to the cloud, the need to remotely access and control servers has become increasingly important. Often this is achieved using VNC however this has up until now needed a dedicated VNC client installed on the accessing machine and isn't always possible behind corporate firewalls. Likewise, the unencrypted connection makes it unsuitable for use when accessing servers from a public location. That's where Web VNC comes in. Web VNC allows full VNC access directly from a standard web browser to any VNC enabled server in the world. Now any internet connected device with a compatible web browser can be used to access and manage servers over an encrypted connection without the need to install specialist software.

Try it now ! It's Free

Read more: GetApp.com

Posted via email from .NET Info

Silverlight Performance Tip

|
After watching Seema’s PDC talk on Building an Optimized, Graphics-Intensive Application in Microsoft Silverlight I thought it would be useful to summarize what I learned.

1. Debugging

The following items will help you debug performance in your Silverlight application:

•EnableRedrawRegions – Turn on this debug setting to see what and where rectangles are being redrawn within your application. When enabled you can see what is painted because the repaint region is colored in blue, yellow or pink. This property is set when you create your Silverlight plug-in.

Example:

<div style="height:100%">
<asp:Silverlight ID="Xaml1" EnableRedrawRegions="true"
EnableFrameRateCounter="true" runat="server" PluginBackground="Transparent"
Windowless="true" Source="~/ClientBin/Snowflakes.xap"
MinimumVersion="2.0.30523" Width="100%" Height="100%" />
</div>

•MaxFrameRate - To see what components of your application are having the most adverse affect on the performance you can set the MaxFrameRate for your application. You can then experiment with adding and removing components to your application to see how the performance changes. To do set the following properties highlighted below:

<div style="height:100%">
<asp:Silverlight ID="Xaml1" MaxFrameRate="10" EnableFrameRateCounter="true"
runat="server" PluginBackground="Transparent" Windowless="true"
Source="~/ClientBin/Snowflakes.xap" MinimumVersion="2.0.30523" Width="100%"
Height="100%" />
</div>

•XPerf – This is a profiling tool that can be used to analyze performance of your Silverlight application. For example, you can track CPU and disk usage over time. Install from here: http://msdn.microsoft.com/en-us/library/cc305187.aspx. For more details and instructions please see this blog

Read more: 110so1

Posted via email from .NET Info

ASP.NET Webforms and Event Handling

|
To create more active server pages as done in the first example, it is necessary to add code and reference elements of a page. The most simple way is to add a script section in the ‘index.aspx’ source. It may be surprising to see that the event handler is defined as a member function of a System.Web.UI.Page class definition.

In the next example we add an event handler for a button click. As usual you need a ‘web.config’ file and a subdirectory bin with with FSharp.Compiler.CodeDom.dll, see in the first example how to do it, the source file in our example should be named index.aspx:

<%@ Page Language="F#" Trace="false" %>

<script runat="server">
member page.mybutton_Click((sender:obj), (e:EventArgs)) =
page.mybutton.Text <- "Clicked"
</script>

<html>
<body>
<h2>ASP.NET Simple Web Forms Demo</h2>

<form method="post" runat="server">
button: <asp:button id="mybutton" runat="server" Text="Click Me"
         OnClick="mybutton_Click"/>
</form>

</body>
</html>

When starting the web server xsp2 in the directory of your source file you should see the following content in your web browser when pointing it to ‘http://localhost:8080′

Read more: 2#4u

Posted via email from .NET Info

Where Is The SQL Server ErrorLog File?

|
I seldom lose things; I just cannot find them as quickly as I’d like. This is true for keys, tools, and yes even ErrorLog files on SQL Server.

On the servers that I configure, I have a standard way of doing things. I set them up using some industry best practices and some standards that I’ve developed over the years. On those servers, I can find the ErrorLog file quickly since it is in a predictable place for me.

Using T-SQL To Find The ErrorLog File
In my consulting practice, I regularly work with SQL Servers that I did not configure. For those servers, I must discover where things are. One technique that I use is to ask SQL Server itself where things are. For example, the following T-SQL query will return the location of the ErrorLog file.

SELECT SERVERPROPERTY(‘ErrorLogFileName’);

It will return something like the following:

E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG

Read more: WebbTech Solutions

Posted via email from .NET Info

WCF: передача XML и расход памяти

|
Как я писал недавно - http://devlanfear.com/perexod-s-asp-net-web-services-na-wcf/ - мы перевели свой проект с ASP.NET веб-сервисов на WCF.  В процессе перевода столкнулись с проблемой – WCF не хотел сериализовать поле типа XmlNode, пришлось искать пути обхода этой проблемы. Первый вариант был – использовать XmlElement (наследник XmlNode), который сериализуется без проблем. Но при тестировании были обнаружены некоторые нюансы: сериализация XML, имеющим в себе ProcessingInstruction, упорно не работала,к тому же при передаче выходной XML иногда получался кривой –  появлялись дополнительные ChildNode (типа Whitespace) для каждого переноса строк, и не только.

В итоге было отдано предпочтение работе со строками:  

public static XmlNode ToXml(string xml)
      {
          XmlDocument doc = new XmlDocument();
          doc.LoadXml(xml);
          return doc.DocumentElement;
      }

      public static string FromXml(XmlNode xml)
      {
          if (xml == null) return string.Empty;

          return xml.OuterXml;
  }

Конвертация XML в string и обратно выполнялась вышеописанным способом.

Но в итоге столкнулись с целой вереницей проблем: при больших нагрузках на сервисы выпадало исключение OutOfMemory. Причина была совершенно непонятна, т.к. при мониторинге не было замечено ни утечек памяти, ни заметного причинного роста. По данным из EventLog’а ошибка происходила при обращении к свойству OuterXml объекта типа XmlNode, а в итоге здесь - System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)

Read more: <a href="http://devlanfear.com/wcf-peredacha-xml-i-rasxod-pamyati/

London Stock Exchange smashes world record trade speed with Linux

|
The London Stock Exchange has said its new Linux-based system is delivering world record networking speed, with 126 microsecond trading times.

The news comes ahead a major Linux-based switchover in twelve days, during which the open source system will replace Microsoft .Net technology on the group’s main stock exchange. The LSE had long been criticised on speed and reliability, grappling with trading speeds of several hundred microseconds.

The record breaking times were measured on the LSE’s Turquoise smaller dark pool trading venue, where trades are conducted anonymously. That network switched over to Linux from Cinnober technology two weeks ago. Speed is crucial as more firms trade automatically at lightning speed, using advanced algorithms.

Read more: ComputerWorldUK

Posted via email from .NET Info

How to upload files using C#

|
Create FTP Request

FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(FTPAddress + "/" + Path.GetFileName(filePath));

Setup your FTP Settings

request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential(username, password);
request.UsePassive = false;
request.UseBinary = true;
request.KeepAlive = false;

using System.IO we can load the file

Read more: My.I.T.Side

Posted via email from .NET Info

ExportParameters returns Invalid type specified error

|
Some time ago a customer of mine was trying to export the private key associated to a certificate stored in a smart card, and for that he was trying to use the RSACryptoServiceProvider.ExportParameters method with a code like the following:

System.Security.Cryptography.X509Certificates.X509Certificate2 cert = GetCert(certName);
RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)cert.PrivateKey;
RSAParameters params = rsa.ExportParameters(true);

But ExportParameters was returning the following exception:

System.Security.Cryptography.CryptographicException: Invalid type specified

To troubleshoot this error, we took traces with the following debugger script of mine: CryptoAPI Tracer script.

With those traces we saw that the error came from CryptExportKey API. The reason of the error was that the third-party Cryptographic Service Provider (CSP) associated to the certificate won’t allow us to export the private keys from the smart card. This actually makes sense if we think about the main purpose of smart cards in this scenario: hold private keys which can only be accessed directly from the smart card whenever they are needed to sign or decrypt data.

Read more: Decrypt my World

Posted via email from .NET Info

Debugging Android: Using DDMS To Look Under The Hood Submitted by James Sugrue on Wed, 2010/

|
While working on an Android application recently, I ran into some problems, and was finding it difficult to work out what was actually going on in the emulator. As I'm using Appcelerator for my app development, I didn't have the luxury of using the built in Eclipse tools to find out what was wrong. Luckily for me, Google have a tool for this type of situation: the Dalvik Debug Monitor.

You can invoke the debug monitor from the tools directory of your android SDK install using the ddms command.

ddms.PNG

Read more: JavaLobby

Posted via email from .NET Info

Mailbag: How to perform a silent install of the Visual C++ 2010 redistributable packages

|
Question:

You previously posted lists of command line switches to perform silent and unattended installations of the Visual C++ 2005 redistributable and the Visual C++ 2008 redistributable.  How can I perform silent and unattended installations of the Visual C++ 2010 redistributable?

Answer:

The Visual C++ 2010 redistributable packages (vcredist_x86.exe, vcredist_x64.exe and vcredist_ia64.exe) support the following command line installation options.

The examples below use the file named vcredist_x86.exe, but you can substitute the x64 or ia64 versions of the EXEs with equivalent command lines to achieve the same behavior for them as well.

Silent install

This option will suppress all UI and perform an install.

<full path>\vcredist_x86.exe /q /norestart

For example, if you download vcredist_x86.exe to a folder named c:\vc2010redist, then the command line would look like this:

c:\vc2010redist\vcredist_x86.exe /q /norestart

Unattended install

This option will display a progress dialog (but requires no user interaction) and perform an install.

<full path>\vcredist_x86.exe /passive /norestart

For example, if you download vcredist_x86.exe to a folder named c:\vc2010redist, then the command line would look like this:

c:\vc2010redist\vcredist_x86.exe /passive /norestart

Silent repair

This option will suppress all UI and perform a repair.

<full path>\vcredist_x86.exe /q /repair /norestart

For example, if you download vcredist_x86.exe to a folder named c:\vc2010redist, then the command line would look like this:

c:\vc2010redist\vcredist_x86.exe /q /repair /norestart

Silent uninstall

This option will suppress all UI and perform an uninstall.

<full path>\vcredist_x86.exe /q /uninstall /norestart

Read more: Aaron Stebner's WebLog

Posted via email from .NET Info

Accessing Server-Side Data from Client Script

|
Introduction
When building a web application, we must decide how and when the browser will communicate with the web server. The ASP.NET WebForms model greatly simplifies web development by providing a straightforward mechanism for exchanging data between the browser and the server. With WebForms, each ASP.NET page's rendered output includes a <form> element that performs a postback to the same page whenever a Button control within the form is clicked, or whenever the user modifies a control whose AutoPostBack property is set to True. On postback, the server sends the entire contents of the web page back to the browser, which then displays this new content. With WebForms we don't need to spend much time or effort thinking about how or when the browser will communicate with the server or how that returned information will be processed by the browser. It just works.

While this approach certainly works and has its advantages, it's not without its drawbacks. The primary concern with postback forms is that they require a large amount of information to be exchanged between the browser and the server. Specifically, the browser sends back all of its form fields (including hidden ones, like view state, which may be quite large) and then the server sends back the entire contents of the web page. Granted, there are scenarios where this large quantity of data needs to be exchanged, but in many cases we can use techniques that exchange much less information. However, these techniques necessitate spending more time and effort thinking about how and when to have the browser communicate with the server and intelligently deciding on what information needs to be exchanged.

This article, the first in a multi-part series, examines different techniques for accessing server-side data from a browser using client-side script. Throughout this series we will explore alternative ways to expose data on the server so that it can be accessed from the browser using script; we will also examine various tools for communicating with the server from JavaScript, including jQuery and the ASP.NET AJAX library. Read on to learn more!

Read more: 4 Guys from Rolla.com

Posted via email from .NET Info

The Razor View Engine Basics

|
If you’ve been following me, you probably noticed that I became quite excited with the new view engine of ASP.NET MVC 3 – the razor view engine. If you’re familiar with it then you might agree or disagree with me, but if you don’t then this is a great time for you to make up your mind!

In this post I assume you are familiar with the concept of view engines. If not, please watch this before.

Let’s start.

At Sign (@) Galore
The razor view engine is all about the at sign (@). Unlike the inelegant <% %> signs of the common web forms view engine, here all you need is the at sign.
Basically, starting an expression with the at sign will lead to this expression being evaluated and output the result to the page. For example:

@DateTime.Now
This expression will end up printing the current date and time to the response stream. It is the equivalent of the following web forms view engine code:

<%: DateTime.Now %>
Note
At sign expressions are html encoded!
If you’re sure your output is OK and you don’t want it to be html encoded, you need to provide an IHtmlString object, or simply do:
@MvcHtmlString.Create("<b>BOLD!</b>")
By now some of you might be scratching your heads, moving anxiously in your sits or eating Ben & Jerry's uncontrollably… all of this because something is disturbing you with that line of code… something is missing…

It’s Magic! Magic!!!!!!11
Well, you were right! something is, indeed, missing… we only started the expression with the at sign, but we never told the framework where the expression ended!!! God help us all!!!

Do not worry. This is part of the charm of Razor – if your expression is a single call, there is no need to enclose it in some sort of way, you just write the expression after the at sign (and make sure it’s immediately after the at sign! for example, @ DateTime.Now will raise an exception).

Wait! But what about the times I wanna use blocks of code? or when I want to write out the result of 1 + 1? No problem, I have the solution for you! (how many times have you heard that before, right?)

So for simple expressions like additions (1 + 1, “Shay” + “ “ + “ Friedman”…) you enclose the expression in brackets. For example:

@(1 + 1)
@("Shay" + " " + "Friedman")
A Moment of Truth
What will happen if you write:
@"Shay" + " " + "Friedman"
?
... think for a moment ...
Answer: a "Parser Error" exception. Yes, get used to it.
Now, sometime you need actual code blocks like loops or conditions… and these brackets won’t help you there, son. And look carefully, because this is where it gets a bit… surprising.

Code Blocks and Razor Sitting in a Tree, K-I-S-S-I-N-G
Let’s start with the simplest use case – you want to set a variable within your view. How would you do that? @int a = 1; ? no no no. To do that, you enclose the code block within curly brackets, with an at sign at the beginning of course. For example, the next sample will output 1 to the page:

@{
   int a = 1;
}
@a
This was a very simple sample though… what about conditions for example? I’m glad you asked!

One way to write conditions (or any block of code), is by using the curly brackets solution:

@{
   string s = String.Empty;
   if (DateTime.Now.Year == 1980)
   {
       s = "Man you're so 80's!";

Read more: IronShay

Posted via email from .NET Info

Silverlight. Основы. Валидация. Часть 2. IDataErrorInfo & INotifyDataErrorInfo

|
Еще пару слов про ValidatesOnExceptions
Забыл сказать, что если вам хочется построить валидацию на исключениях, то совсем не обязательно использовать DataAnnotations, можно очень просто выбрасывать исключения прям из set методов. Например, для проверки того, что повторно введенный пароль из прошлого примера совпадает с перво-введённым паролем, можно сделать так:

[Display(Name = "New password confirmation")]
public string NewPasswordConfirmation
{
   get { return _newPasswordConfirmation; }
   set
   {
       _newPasswordConfirmation = value;
       OnPropertyChanged("NewPasswordConfirmation");
       ChangePasswordCommand.RaiseCanExecuteChanged();
       if (string.CompareOrdinal(_newPassword, value) != 0)
           throw new Exception("Password confirmation not equal to password.");
   }
}

Так, конечно, выглядит намного проще, чем описывать все на аттрибутах (в случае CustomValidationAttribute).

IDataErrorInfo

IDataErrorInfo интерфейс пришел вместе с Silverlight 4. Он нам поможет избавиться от передачи сообщений об ошибках инфраструктуре Silverlight основанной на бросании исключений. Все, что нужно сделать – это реализовать два описанных в этом интерфейсе метода/свойства. Чаще всего разработчики начинают с того, что добавляют некий класс-обработчик, который хранит коллекцию сообщений об ошибках:

public class ValidationHandler
{
   private Dictionary<string, string> BrokenRules { get; set; }

   public ValidationHandler()
   {
       BrokenRules = new Dictionary<string, string>();
   }

   public string this[string property]
   {
       get { return BrokenRules[property]; }
   }

   public bool BrokenRuleExists(string property)
   {
       return BrokenRules.ContainsKey(property);
   }

Read more: outcoldman

Posted via email from .NET Info

Getting the WebOperationContext of a HTTP response in Silverlight

|
This came up as a question from a customer today: how do you get details of the HTTP response message that a WCF proxy in Silverlight received? If you thought of  OperationContext and WebOperationContext, you’re on the right track, but you have only half of the story.

In Silverlight, in order to get to these context objects, you have to switch from the event-based async pattern to the more complex Begin/End-based async pattern. Within that pattern, you need to instantiate an OperationContextScope and call the End* method inside that scope, before you can access the context objects themselves. Check out this code snippet:

public MainPage()
{
   Service1 proxy = new Service1Client() as Service1;
   proxy.BeginDoWork(new AsyncCallback(Callback), proxy);
}

void Callback(IAsyncResult result)
{
   Service1 proxy = result.AsyncState as Service1;

   using(new OperationContextScope((proxy as Service1Client).InnerChannel))
   {
       string foo = proxy.EndDoWork(result);
       // Don't forget to reference System.ServiceModel.Web.Extensions.dll
       // from the Silverlight SDK, otherwise WebOperationContext won't be
       // recognized

       // Get the HTTP status code or anything else WebOperationContext gives you
       HttpStatusCode status = WebOperationContext.Current.IncomingResponse.StatusCode;
   }
}

Read more: Yavor Georgiev

Posted via email from .NET Info

Xte Profiler

|
.NET Profiler
Xte Profiler is a trace and memory profiler for .NET.

Supports .NET CLR v2 and v4 (.NET Frameworks 2.0, 3.0, 3.5 and 4.0)
Supports profiling of Windows executables, ASP.NET Development server applications, IIS applications, Windows services and Silverlight 4 applications.
Supports trace and memory profile modes.
and more...


Read more: Xte Profiler

Posted via email from .NET Info

How to Create HTML5 Website and Page Templates for Visual Studio 2010

|
Now that I work at Microsoft, I’m using Visual Studio 2010 as my main editor. By default, an empty web page is created with an XHTML 1.0 doctype and it’s pretty barebones. Since I’m focusing on HTML5 & JavaScript development, having to constantly update the page with references to the new HTML5 doctype, jQuery, Modernizr and all of the other tags I use for my pages was becoming a drag.

Today, I noticed a blog post by Zander Martineau in which he added a lot of HTML5 goodness to the Coda IDE in the form of clips, which is the code snippet format supported by Coda. This got me inspired to find out how to do something similar in Visual Studio, so I pinged Damian Edwards of the Visual Studio team for advice. He pointed me to the following article which explained how to create “Item Templates” in Visual Stuido.

The gist of it is that you can take any page that you create and turn it into a re-usable template via the “File->Export Template…” wizard. It walks you through the process of choosing a specific file or entire project/website to use as a template.

Adding a Page Template

So here’s the basic HTML5 template I wanted to include:

<!doctype html>
<html lang="en">
<head>
   <meta charset="utf-8" />
   <title></title>
   <meta name="description" content="" />
   <meta name="keywords" content="" />
   <meta name="author" content="" />
   <meta name="viewport" content="width=device-width; initial-scale=1.0" />

   <!-- !CSS -->
   <link href="css/html5reset.css" rel="stylesheet" />
   <link href="css/style.css" rel="stylesheet" />

   <!-- !Modernizr - All other JS at bottom
   <script src="js/modernizr-1.5.min.js"></script> -->

   <!-- Grab Microsoft's or Google's CDN'd jQuery. fall back to local if necessary -->
   <!-- <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script> -->
   <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" ></script> -->
   <script>      !window.jQuery && document.write('<script src="js/jquery-1.4.2.min.js"><\/script>')</script>

</head>

<body>
   <div id="container">

   </div>
</body>

</html>

Read more: REY BANGO

Posted via email from .NET Info

Windows Identity Foundation (WIF) SDK Help Overhaul

|


Read more: Alik Levin's

Posted via email from .NET Info

SQL Server: How to insert million numbers to table fast?

|
Yesterday I attended at local community evening where one of the most famous Estonian MVPs – Henn Sarv – spoke about SQL Server queries and performance. During this session we saw very cool demos and in this posting I will introduce you my favorite one – how to insert million numbers to table.

The problem is: how to get one million numbers to table with less time? We can solve this problem using different approaches but not all of them are quick. Let’s go now step by step and see how different approaches perform.

NB! The code samples here are not original ones but written by me as I wrote this posting.

Using WHILE

First idea for many guys is using WHILE. It is robust and primitive approach but it works if you don’t think about better solutions. Solution with WHILE is here.

declare @i as int
set @i = 0

while(@i < 1000000)
begin    
   insert into numbers values(@i)
   set @i += 1
end

When we run this code we have to wait. Well… we have to wait couple of minutes before SQL Server gets done. On my heavily loaded development machine it took 6 minutes to run. Well, maybe we can do something.

Using inline table

As a next thing we may think that inline table that is kept in memory will boost up performance. Okay, let’s try out the following code.

declare @t TABLE (number int)
declare @i as int
set @i = 0

while(@i < 1000000)
begin    
   insert into @t values(@i)
   set @i += 1
end

insert into numbers select * from @t

Read more: Gunnar Peipman's ASP.NET blog

Posted via email from .NET Info

Simplest way to Create a Non-Movable Silverlight Child Window

|
Are you looking for a Silverlight Child Window, which can’t move from it’s actual position? Then this article will help you to understand & create a non-movable child window in Silverlight.

Child Window is available inside the System.Windows.Controls.dll assembly. By default, it is movable. You can drag the Title Bar of the Window and position it anywhere in the screen. But, you may face some situation when you need to fix the position of the Window by restricting the user to drag it. So, how will you do this?

In this article, I will show you the simplest mechanism to make your child window not movable.

Creating the Basic UI with ChildWindow

Open your Expression Blend and create a Silverlight project. I am not demonstrating you on creating a project now, as I think you are familiar with that. If you are not familiar to that, read any of my earlier articles to know about it.

Once your Silverlight project is with you, go to the “Assets” tab as shown below and start searching for the “ChildWindow”. Add the Child Window to your Grid Layout. Now resize it properly and set a comfortable position of it as per your choice.

image%5B2%5D.png?imgmax=800

Read more: Kunal's Blog

Posted via email from .NET Info

INTEGRATE HTML5 FORM IN ASP.NET MVC

|
This article is divided into three parts. In the first, part I will show you how you can add Html5 forms in your ASP.NET MVC application with very minimum effort. In the second part, I will show you how to implement client side validation which will trigger automatically even when the browser does not have the html5 client side validation support and in the last part I will show widgetify the form in the client side with jQuery for the older browser that does not have support for Html5 form.

Let’s begin with the server side first. To add Html5 form I will utilize the ModelMetadata and DataAnnotation features that are available in ASP.NET MVC. The DataAnnotation has several attributes which we can use when generating the input types. Let’s say I have a dummy model which is fully decorated with the DataAnnotation attributes:

public class Html5FormModel
{
   [Display(Name = "String", Prompt = "Type a string"), Required]
   public string StringProperty { get; set; }

   [Display(Name = "Decimal", Prompt = "Type a decimal"), Range(1.0, 100.0), Required]
   public decimal? DecimalProperty { get; set; }

   [Display(Name = "Date", Prompt = "Type a date"), DataType(DataType.Date), Required]
   public DateTime? DateProperty { get; set; }

   [Display(Name = "Url", Prompt = "Type an url"), DataType(DataType.Url), Required]
   public string UrlProperty { get; set; }

   [Display(Name = "Email", Prompt = "Type an email"), DataType(DataType.EmailAddress), Required]
   public string EmailProperty { get; set; }

   [Display(Name = "Phone number", Prompt = "Type a phone number"), DataType(DataType.PhoneNumber), Required]
   public string PhoneProperty { get; set; }
}

Read more: KAZI MANZUR RASHID'S BLOG

Posted via email from .NET Info

Analyze and validate T-SQL code using SQL Enlight

| Wednesday, October 20, 2010
As databases get bigger, the number of database objects increase and the amount of business logic implemented using T-SQL code becomes quite substantial, often even more critical than the application code; the automation of the process of ensuring code quality is becoming more and more important.

Static code analysis is a popular method for code verification and defect detection in the .NET, C++ and Java development worlds, but very often left behind and neglected by the SQL Server development community.

SQL Enlight is a tool for SQL Server that can automate and facilitate the T-SQL code and database schema analysis. The tool works in a way similar to the .NET focused tools like FxCop and StyleCop. It provides design-time code, database schema and query plan analysis. The tool comes with about 70 out of the box analysis rules and also supports custom analysis rules.

Read more: SQL Server curry

Posted via email from .NET Info

Managing Silverlight resources contained in external assemblies

|
A year ago, I’ve written a post about Managing WPF resources contained in external assemblies.

I am using this pattern in every Prism application I’m developing, the main reason for this is  that I like having each module responsible for his own resources, especially it contains DataTemplates which couple Views to ViewModels.

In each of my module entry classes (which inherit from IModule) I usually add a method which is used on the Initialize phase.

The problem is that the code that has being used by WPF is very different from the code you need to use in Silverlight.

So here you go:

private static void RegisterResources()
{
   ResourceDictionary dictionary = new ResourceDictionary();
   StreamResourceInfo resourceInfo = Application.GetResourceStream(new Uri("[ASSEMBLY NAME];component/[SUBFOLDER IF ANY]/{DICTIONARY NAME].xaml", UriKind.Relative));
   StreamReader resourceReader = new StreamReader(resourceInfo.Stream);
   string xaml = resourceReader.ReadToEnd();
   ResourceDictionary resourceTheme = XamlReader.Load(xaml) as ResourceDictionary;
   Application.Current.Resources.MergedDictionaries.Add(resourceTheme);
}

Note: the strange Uri syntax, every [] is a place holder for you to put in your specific information.

Read more: Ariel's Remote Data Center

Posted via email from .NET Info

Bubbling PropertyChanged Events in Silverlight

|
I’ve been working with Silverlight (specifically for Windows Phone 7) recently and something I’ve found useful is the ability to “bubble” PropertyChanged event up. So for example;

   public class MainPageViewModel : INotifyPropertyChanged
    {
        public ObservableCollection<Person> People
        {
            get
            {
                return  _repository.Items;
            }
        }

        // ... other members ommitted
    }

In this situation I have a repository of Person objects, and that repository implements INotifyPropertyChanged. But I don’t want to expose the repository as part of my View Model because that defeats the point of my encapsulation!
Now, if the ObservableCollection contents change, my View will get notified via the CollectionChanged event and will update itself. But if the repository destroys and replaces the whole collection, the View will never be notified.

My Solution

As a solution to this, I created a very simple class, as follows;

Read more: Simon Ince's Blog

Posted via email from .NET Info

Can you repro this 64-bit .NET GC bug?

|
Whilst developing low latency software on .NET, we have discovered a serious bug in the .NET 4 concurrent workstation garbage collector that can cause applications to hang for up to several minutes at a time.

On three of our machines the following simple C# program causes the GC to leak memory until none remains and a single mammoth GC cycle kicks in, stalling the program for several minutes (!) while 11Gb of heap is recycled:

static void Main(string[] args) {
   var q = new System.Collections.Generic.Queue<System.Object>();
   while (true) {
       q.Enqueue(0);
       if (q.Count > 1000000)
           q.Dequeue();
   }
}


You need to compile for x64 on a 64-bit Windows OS with .NET 4 and run with the default (concurrent workstation) GC using the default (interactive) latency setting.

Read more: The Flying Frog Blog

Posted via email from .NET Info

Silverlight: Why do I get 0x8000ffff when using WriteableBitmap on an Element

|
I'm working on a WP7 library which helps analyze your VisualTree and to provide a visual aid, I take WriteableBitmap snaps of the elements. Unfortunately I (seemingly) randomly encounter the following exception:

A first chance exception of type 'System.Exception' occurred in System.Windows.dll

When digging into the exception you may find that the error is actually a HRESULT which is being bubbled up from the lower native layer:

E_UNEXPECTED (0x8000ffff)

What's going on?

You guessed it - this isn't random! In fact, this only happens on completely obscured (or off screen) elements which have never had a chance to render. In this case when you try to take a WriteableBitmap snap, instead of it forcing the control to render, it simply fails. This will hit you in the case of any element that has always been obscured. As soon as the element is unobscured it will be good to go (so you could do some VisualTree manipulation if you *really* needed to grab that shot).

Read more: Randomisation

Posted via email from .NET Info

Microsoft Office 365 – Videos, demos, resources, and more information for you

|
Earlier today, I posted about our Microsoft Office 365 announcement as well as the announcement of the beta for Microsoft Office 365.  In that post I included several links to things like the beta program, Microsoft partner page for Microsoft Office 365, the Microsoft Office 365 website, the Microsoft Office 365 Twitter & Facebook accounts, and more.  (So be sure you read through the earlier post to make not of those resources as well)

Since that post, there have been several other resources that have come online and I thought I would put up a quick post here on the blog with many of these for you:

  • Did you miss today’s live announcement broadcast?  No worries, we recorded it!  I’ve included it below so you can watch it here on the blog, or you can also click HERE to go directly to the video.
  • Want to see more of what Microsoft Office 365 can bring to you and your clients?  Check out this demo by John Betz, Director of Business Productivity Online Services at Microsoft, as he demos Office 365 across the PC, phone and browser:
  • Check out this video, posted by the Office 365 team, highlighting Microsoft Office 365 and showing what Microsoft Office 365 can bring to users everywhere, of all sizes:

Read more: Microsoft Partner SMB Community Blog - By Eric

Posted via email from .NET Info

Silverlight. Основы. Валидация. Часть 1. DataAnnotations & ValidatesOnExceptions

|
В Silverlight 4 есть несколько способов для валидации введённых данных, точнее несколько подходов для реализации валидации. Первый вариант, реализация валидации на DataAnnotation. Вариант, когда правила валидации описываются при помощи атрибутов. Два других подхода – это реализация одного из интерфейсов IDataErrorInfo или INotifyDataErrorInfo. Я хотел бы остановиться на каждом из подходов, поговорить о преимуществах и недостатках каждого из них. Цель данной статьи выявить лучшие практики для валидации для себя и для вас. Так получилось, что статья оказалась большой, потому реализую ее в два или три подхода. Эта часть только про DataAnnotation.

Подготовка
Итак, давайте перейдем к примеру. Я всю валидацию буду описывать при помощи одного простого окна изменения пароля.

Read more: outcoldman

Posted via email from .NET Info

Useful jQuery Tutorials - September 2010

|
AJAX JSON Datepicker

datejson.jpg

This tutorial shows how to use the jQuery UI datepicker with JSON.

Dissecting jQuery - Grep
Working with the Official jQuery Templating Plugin
jQuery Tabbed Navigation Tutorial
Horizontal Scrolling Menu made with CSS and jQuery

Read more: AjaxLine

Posted via email from .NET Info

Universal COM Callable Wrapper

| Tuesday, October 19, 2010
Introduction

Generic COM Callable Wrapper for any .Net object, class, or type. This is a language-independent COM class library allowing virtual porting of most Microsoft .Net framework classes and types into any COM-aware language. On Windows OS's, if your language of choice can at least work with COM, theoretically with this library, you can now work with any Microsoft .Net class, type and object. It was written in VB using a regular text editor, and compilable using Microsoft's VB compiler.

The compiled dll is meant to be registered as a COM class, making it available in any COM-capable language. Under the hood, the universal functionality is made possible using standard runtime calling and declaration methods. Reflection is used to load assemblies and create wrapped objects and static classes of types declared by you at runtime within the Universal_CCW_Factory class. The standard CallByName() function is used inside the Universal_CCW_Container class to work with a wrapped object's properties and methods. More Reflection methods are used inside the Universal_CCW_Container class to work with a wrapped static type's fields, properties, and to call its methods. For events: an anonymous sub within the Universal_CCW_Container wrapper class acts as a universal Delegate/event handler method. Event handling is nothing new: the anon sub simply copies information about the triggered event to a Queue-type property of the main Universal_CCW_Factory master object.

Regarding events, handling is currently limited to EventHandler and ComponentModel.CancelEventHandler handler types (or any that can comfortably convert down to). This is because I've not yet found a way to force the handler type at runtime. Regarding certain traits of .Net classes that may initiate internal loops, such as the Run method of the Application class: objects and classes exist within a VB.Net trapped environment, meaning you will not be privy to any internal processing going on. An internal loop triggered by any method of the underlying object or class will freeze your project. There is no "main" sub. Therefore, if your project calls for such specialized handling, you should consider making a specialized wrapper.

The form screen-shot below is an example of what can be done using this library under PHP command line scripting. A Windows form is created with textbox and button controls, button click event monitoring, and incorporating a color-picker dialog box to print the decimal value of the chosen color back to the textbox.

Read more: Codeproject

Posted via email from .NET Info

Eye on Visage: Compiler Preview #1 Available

|
The Visage Programming Language is moving forward, with Compiler Preview #1 available now.  This preview features Default Properties, which create a simplified syntax that makes it easier to read nested data structures.  A logo has also been chosen for the project as well.  According to Stephen Chin, founder and leader of the Visage Project:  

"After a lot of searching (and some failed attempts at contacting artists for rights), I ended up with a classical art piece.  A painting by Leonardo da Vinci, La Scapigliata (The Lady of the Dishevelled Hair), was my choice.  Leonardo accentuated the face in this portrait, which seems fitting given the focus of our project.  It also is mostly monochromatic, which should make it easy to incorporate in different mediums."

Read more: Jim Weaver’s Rich-Client Java Blog

Posted via email from .NET Info

Ultimate Guide to speed up Visual Studio

|
I believe that better tools lead to better results. That’s why I care about my tools performance a lot!

Recently I had a conversation with Peter Kirchner and Kay Giza on how to speed up Visual Studio. Specifically by configuring you Anti-Virus software. But beside that there are loads of things that you can do.

So I decided to share the tweaks on environment:

Read more: DANIEL FISHER (@LENNYBACON)

Posted via email from .NET Info

Hardware change detection

|
Introduction

In this article I will describe how to detect device changes in your user-mode applications on the Windows operating system, IOW how to detect the situation when new devices are plugged or removed from the PC (i.e. plug-in USB stick, modem device or mobile phone,  mount/unmount the new disk). Basic approach is receiving notification messages from the system.

Hardware change detecting

Windows sends events to top-level windows about arriving and removing a USB device interface.  All we need to do is to add a handler to handle this event. First of all, we should register our windows to receive device notifications by calling RegisterDeviceNotification function.

This function is defined as follows:

HDEVNOTIFY WINAPI RegisterDeviceNotification(
 __in  HANDLE hRecipient,
 __in  LPVOID NotificationFilter,
 __in  DWORD Flags
);

For the NotificationFilter parameter we will use constant DBT_DEVTYP_DEVICEINTERFACE:

GUID guidForModemDevices = {0x2c7089aa, 0x2e0e, 0x11d1, {0xb1, 0x14, 0x00, 0xc0, 0x4f, 0xc2, 0xaa, 0xe4}};
   DEV_BROADCAST_DEVICEINTERFACE notificationFilter;
   ZeroMemory( &notificationFilter, sizeof(notificationFilter) );
   notificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
   notificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
   notificationFilter.dbcc_classguid = guid;

Window  creating
 The hRecipient parameter in described above RegisterDeviceNotification function  is a window handle or a service status handle. In our sample we will use window handle.

Read more: Codeproject

Posted via email from .NET Info

HowTo: Messaging with MSMQ, an introduction

|
A short time ago I found MSMQ. To say it easy: MSMQ is a system where messages are able to be classified into queues and be converted piece by piece.

Why should I use this?

MSMQ is a system of queues. You put your message into it and than somebody will take it and convert it. This could be very useful in distributed applications for example. So for example it is possible to generate E-Mails, put them in a queue and send them out piece by piece so the server won’t be overloaded. Of course there are a lot more possibilities but this is just an introduction.

Later I’m going to talk about some more advantages and disadvantages and I would be very glad to get some comments from you.

Requirements

The infrastructure is included every ware since XP (?). You only need to activate it in the windows functions:

image_thumb225.png

Read more: Code-Inside Blog International

Posted via email from .NET Info

How to crack Microsoft interview?

|
Welcoming Kavya Sukumar, a developer at Microsoft who would like to share some insights on the interview process and how to crack it!

Hello Kavya, thank you for accepting the invite! Our readers would like to know a little bit about yourself, so..

Yup, sure! I currently work as an Software Development Engineer in Test in Microsoft Corp., Redmond. I joined Microsoft’s India Development Center after graduating in Computer Science and Engineering. After a year in IDC, I moved here to Redmond.

What’s the interview process in top MNC’s like Microsoft?

In Microsoft, there is no fixed interview process or format. It changes with product groups or teams. The most commonly followed interview process consists of four to five rounds each focusing on analytical, problem solving, designing, coding and testing skills of the candidate.
It starts with a screening round, which may be written, telephonic or in person.

In Microsoft, there are three engineering profiles- development, test and program management. Apart from screening candidates, the initial round also decides the profile best suited for you. Once you clear the screening, you proceed to the next round, which is called a ‘loop’. A loop usually consists of three to four people who interview you separately.

Thanks Kavya! That was indeed a detailed explanation. Now, how does a candidate prepare himself for the interview?

Read more: InterviewStreet

Posted via email from .NET Info

Interesting T-SQL problems

|
When I wrote my first article with the same name here, Interesting T-SQL problems, I was thinking it will be a weekly series. However, as it often happens, not all intentions become a reality.So, about a month and a half later, I want to discuss a few problems I encountered in different forums during the time since the last blog, that somehow caught my attention.

The first problem is found here (MSDN thread) and this is a problem of finding duplicates with a twist: the duplicates are considered duplicates by FirstName, LastName, Address, EMail, but also the interval between incoming_timestamp should be less than 4 minutes. Now, let's create the test table simulating the real table and populate it randomly with duplicates:

set nocount on
if OBJECT_ID('Test','U') is not null drop table Test

CREATE TABLE [dbo].[TEST](
[ID] [int] NOT NULL,
[LASTNAME] [varchar](60) NULL ,
[FIRSTNAME] [varchar](60)NULL ,
[ADDRESS1] [varchar](40) NULL,
[HOMEPHONE] [varchar](14) NULL,
[EMAIL] [varchar](70) NULL,
[INCOMING_TIMESTAMP] [datetime] NULL
) ON [PRIMARY]

declare @i int
set @i = 0

while @i < 100000
begin
set @i= @i+1

insert into Test values(@i, 'K','Th','Add','Ph','Em', dateadd(ms, CHECKSUM(newid()), getdate()) )


Read more: Beyond Relational

Posted via email from .NET Info

Use Bing API and MSDN metadata to generate code automagically (Part 1)

|
Working more and more with Garrett Serack on the CoApp project, I found myself needing to query MSDN in a non-traditional manner — programmatically. To be more precise, I needed access to the function prototypes of various APIs for code generation purposes. For the past few months, I tried a number of search facilities, web services, and even experimented with symbol server lookups. In the end, however, I settled on an unlikely solution – Bing.

While not hard, it’s extremely time consuming when your list of APIs reaches about 10 or more. I know this first hand, because I re-implemented over 200 APIs in my previous Windows Vista API on XP (VAIOXP) project. It’s a tedious, error-prone, and debilitating process.

To eliminate steps 1 and 2, and decrease the amount of tedium in step 3, I took advantage of MSDN’s rich (and little known about) metadata. A lot like Flickr, almost every page on MSDN is tagged and categorized with words and phrases. While not so useful for humans, it’s extremely useful to computers and, unlike all the other search engines available today, is indexed! Yes, …

Read more: Greg's Cool [Insert Clever Name] of the Day

Posted via email from .NET Info

Do I need DTC for my SQL Server?

|
I get a lot of questions about the "best" way to configure the Distributed Transaction Coordinator (DTC) for SQL Server on a Windows 2008 cluster. There is no one best way to do it, and the first question you ask should be "do you even use DTC and if so how and how often?". If you don't use DTC or use it rarely, then perhaps you don't need to spend a lot of time coming up with the absolute "best" method for each instance of SQL Server or your application. If your application calls DTC directly or if you use a feature in SQL Server that calls DTC, then you need DTC to be available. Some examples of how SQL Server uses DTC: linked servers, OPENROWSET, OPENQUERY, OPENDATASOURCE, remote procedure calls, BEGIN DISTRIBUTED TRANSACTION, updatable subscriptions for transactional replication (immediate and queued updating are now deprecated). You can choose to enlist in a DTC transaction from CLR, SSIS, and DTS. SQL Server does not support using DTC with some features such as database mirroring.

Read more: Cindy Gross - Troubleshooting, tips, and general advice

Posted via email from .NET Info

Best opensource alternative to Active Directory

|
Check out the 5 best opensource alternative to Active Directory. Directory Servers are used to store all information in the directory. It is primarily used as identity management to authenticate and authorize the Users in the network

OpenDS - Next generation Directory Service
OpenDS is an community project, building a free and comprehensive next generation directory service. OpenDS is designed to address large deployments, to provide high performance, to be highly extensible, and to be easy to deploy, manage and monitor. The OpenDS directory service will ultimately include not just the Directory Server, but also other essential directory-related services like directory proxy, virtual directory, namespace distribution and data synchronization.

389 Directory Server - Powerful OpenSource LDAP
The enterprise-class Open Source LDAP server for Linux. It is hardened by real-world use, is full-featured, supports multi-master replication, and already handles many of the largest LDAP deployments in the world. OpenLDAP and Fedora Directory Server were both derived from the original University of Michigan slapd project. In 1996 the original developers of slapd became Netscape employees and developed Netscape Directory Server, which is now Fedora Directory Server.

OpenLdap - community developed LDAP software
OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol. The OpenLDAP Project was started in 1998 by Kurt Zeilenga. The project started by cloning the LDAP reference source from the University Of Michigan where a long-running project had supported development and evolution of the LDAP protocol.

Read more: Best Open Source

Posted via email from .NET Info

A quick list of resources Developers using IIS

|

Network and Sharing Center Operations Guide

|
Overview
You can use this guide to administer Network and Sharing Center in Windows® 7, Windows Server® 2008 R2, Windows Vista, and Windows Server 2008.Network and Sharing Center provides a centralized location where you can view, create, and modify local area network (LAN), wireless local area network (WLAN), virtual private network k. (VPN), dial-up, and Broadband connections on your client and server computers. In addition, you can configure connections to the local computer and sharing options that specify the content that is available to other computers and devices on the network.

Read more: MS Download

Posted via email from .NET Info

On Dynamic Objects and DynamicObject

|
As you know if you read my blog, C# 4.0 introduced some language features that help you consume dynamic objects. Although it’s not part of the language, most of the writing about dynamic in C# that I have seen, including my own, also contains some point about how you create dynamic objects. And they usually make it clear that the easiest way to do that is to extend System.Dynamic.DynamicObject. For instance, you might see an example such as the following, which is pretty straight-forward:

using System;
using System.Dynamic;

class MyDynamicObject : DynamicObject
{
   public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
   {
       Console.WriteLine("You called method {0}!", binder.Name);
       Console.WriteLine("... and passed {0} args.", args.Length);
       result = null;
       return true;
   }
}

class Program
{
   static void Main(string[] args)
   {
       dynamic d = new MyDynamicObject();
       d.Foo(d, 1, "bar");
   }
}

... that prints:

You called method Foo!
... and passed 3 args.

That’s all well and good. But I want to tell you that although this works and is easy, DynamicObject is not a type that is specially known to the DLR, and that this is not the primary mechanism to define dynamic objects. The primary mechanism is to implement the interface IDynamicMetaObjectProvider, and to provide your own specialization of DynamicMetaObject. These two types are specially known to the DLR and they are the mechanism by which dynamic (including DynamicObject) really works. DynamicObject is a tool of convenience. You could write it yourself, if you wanted to. The design of DynamicObject deliberately introduces some trade-offs in the name of ease-of-use, and if your code or library is not OK with those trade-offs, then you should consider your alternatives.

Binding vs. executing
One thing that DynamicObject does to your dynamic objects is that it confuses two separate “phases” of the execution of a dynamic operation. There is a lot of machinery in the DLR that is designed to make your dynamic operations fast, and there are concepts called “call sites” and “rules” and “binders,” etc., and you can dig into this yourself if it’s important, but the upshot is: when a dynamic operation is bound at runtime, the binding is cached using something called a “rule” that indicates the circumstances under which to execute some code, as well as the code to execute. Subsequent to the binding, the code the binding produced is simply run when needed.

Read more: Chris Burrows' Blog

Posted via email from .NET Info

How to create Fixed Header in GridView Control

|
אחת מהדרישות שחוזרות על עצמן בפרויקטים שונים היא ששורת הכותרות של ה – Grid תשאר קבועה במהלך הגלילה. הפתרון הראשון שעולה על הדעת הוא לייצר טבלה נפרדת עם שורת הכותרות ולהוסיף רק לגריד את יכולת הגלילה, הבעיה היא שזה די מייגע למדוד פיקסלים ולדייק שהגריד יישב בדיוק מתחת לשורת הכותרות. פתרון נוסף ואלגנטי יותר שאותו אני רוצה להציג מתבצע באמצעות שימוש ב – CSS.

Expression in Css

כדי לקבע את שורת הכותרת נגדיר קלאס בקובץ ה – Css:

.GridHeaderSettings
{

font:12px;
position:relative;
top:expression(document.getElementById("ParentDiv").scrollTop);
}

ה - Top של שורת הכותרת תמיד יחסי ל – Top של ה – Div שיעטוף את הגריד שלנו.

The GridView Coulmns

כך נראה Coulmn טיפוסי בגריד:

<asp:TemplateField HeaderText="מטוס זנב" HeaderStyle-CssClass="GridHeaderSettings">
       <itemtemplate>
        <asp:Label ID="lblTailNumber"
           runat="server" Font-Bold="true" CssClass="GridTailNumber"
           ForeColor="Red"
           Text="<%#GetTailNumber(Container.DataItem) %>">">
        </asp:Label>
        <asp:Label ID="lblTailOrderNumber"
          runat="server"

Read more: Dovi Perla

Posted via email from .NET Info

Authorization and Authentication using WCF Security - Silverlight

|
  In my previous articles Silverlight 4.0 - Calling Secured WCF 4.0 Service hosted with SSL and Self-Signed Certificate, we saw how to consume WCF SSL enabled service in Silverlight 4.0 client and in the article Silverlight 4.0 - Secure Communication to WCF service using Custom User Name and Password Validator, we saw how to authenticate a user using by using custom user name and password. As an extension to these articles, we will now  explore how to authenticate a Silverlight user against WCF service to perform business operations like Read All and Insert etc.

To perform these operations, I have used the Windows Server 2008 R2 with Active Directory configurations and added two users in it as shown below:

·         Domain Name: Mithilla.
·         User 1: Leena.
·         User 2: Tejas.

In .NET framework we have been provided with ‘System.Security’ namespace using which ‘PrincipalPermission’ can be set on various operations exposed by WCF services. This object provides ‘Name’ and ‘Role’ properties using which operations can be configured against user name of its role, to execute a specific operation in the WCF service.      
In this article, we will design a WCF service which is hosted on IIS with SSL and Self signed certificate. The complete process of configuring and comsuming SSL and self signed certificates is already explained here Silverlight 4.0 - Calling Secured WCF 4.0 Service hosted with SSL and Self-Signed Certificate
Creating a WCF service with Authorization attributes

Step 1: Open VS2010 and create a blank solution and name it as ‘WCF_Authorization_Authentication’. In this solution, add a WCF service project and name it as ‘WCF_Authorization_Service’. Rename ‘IService1.cs’ to ‘IService’, rename ‘Service1.svc’ to ‘Service.svc’.
Step 2: Right click ‘Service.svc’ and select ‘View Markup’ and change the ‘Service’ attribute of @ServiceHost as below:

<%@ ServiceHost Language="C#" Debug="true" Service="WCF_Authorization_Service.Service" CodeBehind="Service.svc.cs" %>

Step 3: Open ‘IService.cs’ and write the following code for ServiceContract and OperationContract etc.

using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace WCF_Authorization_Service
{
   [ServiceContract]
   public interface IService
   {
       [OperationContract]
       List<Employee> GetAllEmployees();
       [OperationContract]
       [FaultContract(typeof(CustomFaultMessage))]
       void CreateEmployee(Employee objEmp);
   }

   [DataContract]
  public class Employee
   {
       [DataMember]
       public int EmpNo { get; set; }

Read more: net curry .com

Posted via email from .NET Info

Silverlightbox released on Codeplex

|
Few hours ago I released a new project on Codeplex called Silverlightbox. The purpose of this project is to create a replacement for the javascript lightbox, used widely in many websites to display images and slideshows. The project works adding a silverlight overlay to the page that is showed when an hyperlink to an image is hit.
The Silverlightbox I released is compatible with the javascript lightbox. You can easily change the scripts of lightbox with my scripts and it works seamless without any change to the HTML already tagged for the lightbox. To have a look at how it appear try to click one of these images

Read more: Silverlight Playground

Posted via email from .NET Info