Friday, December 21, 2007
Difference between Convert and BitConverter classes
"BitConverter is specifically to convert from types to bytes[] and from bytes[] to types."
Tuesday, December 18, 2007
BindingElements List
System.Reflection.Assembly asm;
asm = Assembly.Load("System.ServiceModel");
foreach (Type obj in asm.GetTypes())
{
if ((obj.Name.EndsWith("Binding")) && (obj.IsAbstract == false)&&((obj.Namespace == "System.ServiceModel")||(obj.Namespace == "System.ServiceModel.MsmqIntegration")))
{
System.ServiceModel.Channels.Binding MyBinding = (System.ServiceModel.Channels.Binding)asm.CreateInstance(obj.FullName);
Console.WriteLine("\'Binding Elements\' for Binding {0}", MyBinding.GetType().FullName);
try
{
foreach (System.ServiceModel.Channels.BindingElement element in MyBinding.CreateBindingElements())
{
Console.WriteLine("\t{0}", element.GetType().Name);
}
}
catch (InvalidOperationException ex)//If PNRP is not enabled on the machine then NetPeerTcpBinding.CreateBindingElements() raises an InvalidOperationException
{
Console.WriteLine("Exception occured at {0} \n\t {1}", MyBinding.Name, ex.Message);
}
Console.WriteLine("===========================");
}
}
Console.ReadLine();
=============================================================================
From the result of the above , we can see that, apart from MsmqIntegrationBinding, all other bindings has a element each for Transport and Encoding.
Friday, November 2, 2007
XBRL - eXtensible Business Reporting Language
USP:- XBRL is being developed by an international non-profit consortium of approximately 450 major companies, organisations and government agencies. It is an open standard, free of licence fees.
http://www.xbrl.org/WhatIsXBRL/
Monday, July 16, 2007
Stop move to destroy BSNL, Maran tells PM
15:41 IST
New Delhi: Dayanidhi Maran, who was forced by DMK to quit the communications ministry, Sunday struck back by asking Prime Minister Manmohan Singh to inquire into attempts by an NRI businessman and other vested interests to stall the tendering process of Bharat Sanchar Nigam Limited.
The letter sent by the Lok Sabha MP to the PM earlier today, seeks to find out the truth regarding “the false propaganda being carried out to tarnish my name, plant doubts in the minds of the public regarding my integrity and the ulterior motive to destroy BSNL”.
Maran’s letter, his first public comment after his ouster from the ministry, is sure to create complications for his successor A Raja, who has been pushing for a review of BSNL’s mammoth 45 million GSM connections order on the grounds that the company is overpaying by as much as Rs 10,000 crore.
The two-page letter, without naming either Raja or the NRI businessman, goes on to say that “a sinister campaign is being carried out systematically against me through the media by certain vested interests.
As a minister, it was always my practice to stay out of the tendering process of not only BSNL but also MTNL. The tender, in question, was finalised only by the BSNL board”.
Maran alleged that the NRI businessman, in trying to stall BSNL’s growth, was facilitating the undue growth of private operators.
Although news of Maran’s letter broke in the evening, Raja had earlier during the day told reporters in Chennai that he would resign if the BSNL employee union’s allegations that his actions were hurting the company were proved.
“Unions owing allegiance to the Left parties have misunderstood me on the issue. I want to know if my actions had affected BSNL. Did I cancel the tender? I only asked them to revise the financial bid, which will save a lot of money,” he said.
It remains to be seen as to what view the prime minister takes on Maran’s letter. The political consensus is that the letter is a vain effort and would only add to Maran’s isolation within his party.
The DMK is a powerful constituent of the UPA government and has made it clear that it will run the communications ministry without any interference.
Thursday, June 28, 2007
ADO.net- Difference between using a IPAddress OR a Server name in the Connection String
I got the answer Now-
IPAddress will always create a TCP/IP connection from client to SQL Server instance. This will hold true even if you are connecting to the SQL Server running on Local machine [where the client is also running] and Shared Memory option of that SQL Server instance is enabled.
If you use a Server name [or local, localhost,period(.) etc.]in the connection string, SqlClient will first check if the instance is running on local machine, If Yes, then whether SQLServer Shared Memory is enabled, and if Yes too, then it will connect using shared Memory rather than using any other protocol like TCP/IP,Named Pipe etc. to connect to the server.
To test this I’ve done following-
I installed SQLExpress on my local machine.For SQlExpress, only the shared memory connection type on the local machine is accessible by default, although the user can explicitly turn on other supported protocols such as TCP/IP and Named Pipes.
I created a simple .Net Winform which connects to AdventureWorks DB to show data from SalesOrderHeader in a DataGridView [This is the simplest stuff I could have tried with :-)]
Everything worked fine as I was able to show table data onto my Grid.
My App.config had an entry for SQL Connection string which uses my machine name for data Source-
When I changed this connection string to use MYIPADDRESS instead of MYMACHINENAME, I got the error "provider: SQL Network Interfaces, error: 28 - Server doesn't support requested protocol".
I went to Surface Area Configuration tool to enable Remote connections with support to TCP/IP.
I restarted the SQL engine before running my application again and ..... Bingo! Everything starts working again.
This behaviour can be helpful while using replication, when both the main server and replication server are installed on the same machine.
I am not sure whether this can be true when connecting from .Net client to a Local Oracle DB with shared memory enabled, I need to try that. Once done I will post the results.
Wednesday, June 27, 2007
SCSF and Enterprise library 3.1 Binaries Issue
I created a project in SCSF and tried to open configuration file[Shell.exe.config] from compiled binary folder using the EntLibConfig.exe found in C:\Program Files\Microsoft Enterprise Library 3.1 - May 2007\Bin folder.
To my surprise I kept on getting error related to 'Could not load file or Assembly 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll' ..etc...etc.... .
I tried many other options like copying this tool to Application binaries folder, Copying Application binaries to EntLib binaries folder etc. But I couldn't succeed.
Then after some Googling I found the solution.
The problem relates to Precompiled binaries of Enterprise Library 3.1, Which are Strong named by default [while compiled by MS guys].
While SCSF by default uses Non-Strong named enterprise library binaries.
So here is the issue of a Mismatch.
I compiled the Enterprise library source code to produce Non-Strong named assemblies, which got compiled to 'C:\EntLib3Src\App Blocks\bin' folder. Then by using EntLibConfig.exe from C:\EntLib3Src\App Blocks\bin folder, everything starts working.
Thanx to the Toms' blog which helped me to get to the solution.
ENJOY
P.S: You can install the source code for EL from
Start-->All Programs--> Microsoft Patterns and Practices -->Enterprise Library 3.1-May 2007 --> Enterprise Library Source Code Installer
Wednesday, June 20, 2007
How to add customized folders to Open and Save as dialog boxes left Pane
How to customize the Places Bar in Office 2000
For Office XP - Changes should be done at following Registry entries-
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\Open Find\Places\UserDefinedPlaces
For Windows dialog boxes Check this-
Windows Tweak: Add Shortcuts to Save As
Common DWORD entries-
0 Desktop
1 Internet Explorer
2 Programs
3 control panel
4 Printer Faxex
5 My Documents
6 Favorites
7 Startup
8 My Recent Documents
9 Send To
10 Desktop Folder
11 My Computer
12 My Network Places
13 Nethood
14 Fonts
Tuesday, May 22, 2007
SilverLight Ahead
Flash competitor to support VB programming; may show up in cell phones and on Linux
By J. Nicholas Hoover InformationWeek April 30, 2007 01:00 PM (From the April 30, 2007 issue)
At Microsoft's sold out conference for Web designers and developers this week in Las Vegas, Mix 07, the company will release a test version of its Adobe Flash competitor, Silverlight, and deliver, finally, a long-in-development set of tools called Expression Studio. These products are meant to shore up a Microsoft weak spot: Web interface design. "They're competing for the next generation of eyeballs," says Forrester Research analyst Jeffrey Hammond. "Microsoft correctly understands that these technologies are where the next generation of user interface design is going to happen."
Version one of Silverlight, due for general release later this year, will include Microsoft's Ajax library, a JavaScript engine, and the ability to play WMV, WMA, and MP3 files, as well as the ability to execute code written in .Net languages C# and Visual Basic .Net. The next version, Silverlight 1.1, will add controls for layout and editing, Developers used to working with Microsoft's .Net platform should be relatively comfortable working with Silverlight since it uses a subset of the .Net technology. Microsoft will introduce at Mix test versions of Visual Studio .Net 3.0 tools that can be used to build Silverlight apps.
Microsoft is catching up to competitor Adobe Systems(ADBE), which acquired the Flash technology, a Web multimedia standard, when it bought Macromedia in 2006. Adobe offers both the Flash Player, a runtime multimedia engine that operates in various Web browsers, and the Flex Builder development environment. Perhaps anticipating Microsoft's competitive push, Adobe said last week it would make Flex available as open source code under the Mozilla open source license, potentially greatly expanding the community of developers committed to working with Flash.
Silverlight, Expression Studio, and Windows Presentation Foundation, the user interface technology in .Net 3.0, represent Microsoft's plays in the emerging area of dynamic interface design. Darin Brown, executive VP of global strategy at Avenue A/Razorfish, which has designed Web experiences for Coca-Cola, Nike, Toyota, and Visa, is confident that Microsoft is putting "serious weight" behind Silverlight. Having two major players in the field is good news to companies otherwise uncomfortable moving from a page-based world on the Web to one dominated by graphical, dynamic, interactive presentations, he says. "There are legions of Microsoft developers out there, so it enables a much larger base of people who can create with this stuff," Brown says. "And that will have an exponential effect in moving the industry forward."
Thursday, April 12, 2007
Calling Delegates Asynchronously
using System.Threading;
public class Test
{
delegate int TestDelegate(string parameter);
static void Main()
{
TestDelegate d = new TestDelegate(PrintOut);
d.BeginInvoke("Hello", new AsyncCallback(Callback), d);
// Give the callback time to execute - otherwise the app
// may terminate before it is called
Thread.Sleep(1000);
}
static int PrintOut (string parameter)
{
Console.WriteLine(parameter);
return 5;
}
static void Callback (IAsyncResult ar)
{
TestDelegate d = (TestDelegate)ar.AsyncState;
Console.WriteLine ("Delegate returned {0}", d.EndInvoke(ar));
}
}
Thursday, April 5, 2007
Tracing network Root using .NET code
To trace the route from your location to a distant IP address, you perform multiple ping attempts.
On the first attempt, the TTL parameter is set to 1, causing the first network node to cease forwarding and return an error.
The error contains information about that node.
On the next attempt, the TTL parameter is set to 2, causing the second node in the path to return an error.
The TTL parameter is incremented by 1, causing each subsequent node to return an error until the destination is reached.
This provides information about every node on the path between your machine and the destination server.
For complete .NET code check http://msd2d.com/newsletter_tip.aspx?section=dotnet&id=abf47aa9-ec5b-456e-a2f9-1ad0fd10a2f5
Wednesday, March 21, 2007
Implementing the Singleton Pattern in C#
Implementing the Singleton Pattern in C#: "various different "
If you find anything better , do let me know.
Wednesday, February 7, 2007
Vista Upgrade - Workaround Discovered For "Clean Install" With Vista Upgrade DVDs
For the benefit of others here is a good link to follow for getting over the pains of a Upgrade-
DailyTech - Workaround Discovered For "Clean Install" With Vista Upgrade DVDs
Here is the summary-
- Boot from the Windows Vista Upgrade DVD and start the setup program.
- When prompted to enter your product key, DO NOT enter it. Click "Next" and proceed with setup. This will install Windows Vista as a 30-day trial.
- When prompted, select the edition of Vista which you have purchased and continue with setup.
- Once setup has been completed and you have been brought to the desktop for the first time, run the install program from within Windows Vista.
- This time, type in your product key when prompted.
- When asked whether to perform an Upgrade or Custom (advanced) install, choose Custom (advanced) to perform a clean install of Vista. Yes, this means that you will have to install Vista for a second time.
- Once setup has completed for the second time, you should be able to activate Windows Vista normally. You can also delete the Windows.old directory which contains information from the first Vista install.
Wednesday, January 24, 2007
Monday, January 22, 2007
Enterprise Library 3.0 January 2007 CTP
I am downloading this and will try it out!!!
Tuesday, January 16, 2007
Comparing Web Site Projects and Web Application Projects
The new Web application project model provides the same Web project semantics as Visual Studio .NET 2003 Web projects. This includes a structure based on project files and a build model where all code in the project is compiled into a single assembly. However, the new project type makes available all the new features of Visual Studio 2005 (refactoring, class diagrams, test development, generics, and so on) and of ASP.NET 2.0 (master pages, data controls, membership and login, role management, Web Parts, personalization, site navigation, themes, and so on).
The Web application project model in Visual Studio 2005 also removes two requirements from Visual Studio .NET 2003:
- Using FrontPage Server Extensions (FPSE). These are no longer required, but they are supported if your site already uses them.
- Using a local copy of IIS. The new project type supports both IIS and the built-in ASP.NET Development Server.
The following two tables describe the differences between Web application projects and Web site projects. The first table highlights various scenarios and tasks and suggests which model is best suited to that task. The second table describes in more detail the behavioral differences between each model. Use the tables to guide you in selecting which model to select.
The following table lists Web project options or tasks and indicates which project model best implements those options.
Option or Task Web Application Projects Web Site Projects
Need to migrate large Visual Studio .NET 2003 applications X
Prefer single-page code model to code-behind model X
Prefer dynamic compilation and working on pages without building entire site on each page view (that is, save file and then simply refresh the page in the browser). X
Need to control names of output assemblies X
Need to generate one assembly for each page X
Need stand-alone classes to reference page and user control classes X
Need to build a Web application using multiple Web projects X
Need to add pre-build and post-build steps during compilation X
Want to open and edit any directory as a Web project without creating a project file X
The following table helps you select a project type by describing some of the key differences between Web application projects and Web site projects.
Scenario Web Application Project Web Site Project
Project definition Similar to Visual Studio .NET 2003. Only files that are referenced in the project file are part of the project, are displayed in Solution Explorer, and are compiled during a build. Because there is a project file, some scenarios are more easily enabled:
You can subdivide one ASP.NET application into multiple Visual Studio projects.
You can easily exclude files from the project and from source code-control. Web site projects use the folder structure to define the contents of the project. There is no project file and all files in the folder are part of the project.
This project type is desirable if you have an existing folder structure representing an ASP.NET application that you want to edit in Visual Studio without having to explicitly create a project file.
Compilation and build outputs The compilation model for Web application projects is very similar to that in Visual Studio .NET 2003.
All code-behind class files and stand-alone class files in the project are compiled into a single assembly, which is placed in the Bin folder. Because this is a single assembly, you can specify attributes such as assembly name and version, as well as the location of the output assembly.
Certain other applications scenarios are better enabled, such as the Model-View-Controller (MVC) pattern, because they allow stand-alone classes in the project to reference page and user control classes. The Build command compiles Web site projects only to test them. To run Web site projects, you deploy source files and rely on ASP.NET dynamic compilation to compile pages and classes in the application.
Alternatively, you can precompile the site for performance, which uses the same compilation semantics as ASP.NET dynamic compilation. The ASP.NET dynamic compilation system has two modes—batch mode (the default) and fixed-names mode. In batch mode, many assemblies (typically one per folder) are produced when precompiling the site. In fixed mode, one assembly is produced for each page or user control in the Web site.
Iterative development To run and debug pages, you must build the entire Web project. Building the entire Web application project is usually fast, because Visual Studio employs an incremental build model that builds only the files that have changed. You can configure build options Visual Studio 2005 for when you run the site: build the site, an individual page, or nothing at all. In the last case, when you run a Web site, Visual Studio simply launches the browser and passes to it the current or start page. The request then invokes ASP.NET dynamic compilation.
Because pages are compiled dynamically and compiled into different assemblies as needed, it is not required that the entire project compile successfully in order to run and debug a page.
By default, Visual Studio completely compiles Web site projects whenever you run or debug any page. This is done to identify compile-time errors anywhere in the site. However, a complete site build can significantly slow down the iterative development process, so it is generally recommended that you change the build project option to compile only the current page on run or debug.
Deployment Because all class files are compiled into a single assembly, only that assembly needs to be deployed, along with the .aspx and .ascx files and other static content files.
In this model, .aspx files are not compiled until they are run in the browser. However, when used with Web Deployment Projects (a downloadable add-in to Visual Studio 2005), the .aspx files can also be compiled and included in a single assembly for deployment.
Each time you deploy the single assembly produced in this model, you replace the code for all pages in the project. Both .aspx files and code-behind files can be compiled into assemblies using the Publish Website command in Visual Studio. (Note that the Build command does not create a deployable set of assemblies.) The updateable publish option supports compiling only code-behind files while leaving .aspx files unchanged for deployment.
The default mode for precompiling produces several assemblies in the Bin folder, typically one per folder. The fixed-names option produces one assembly per page or user control and can be used to create deployable versions of individual pages. However, the fixed-names option increases the number of assemblies and can result in increased memory usage.
Upgrade from Visual Studio .NET 2003 Because the Web application project model is the same as in the Visual Studio .NET 2003, upgrade is generally simple and will usually not require any restructuring of the application. The compilation option for Web site projects is significantly different than Visual Studio .NET 2003. A conversion wizard is available to upgrade existing Visual Studio .NET 2003 Web projects to Web site projects. For any reasonably complex Visual Studio .NET 2003 projects, manual fix-up is usually required after the conversion. For most scenarios, it is preferable to upgrade existing Visual Studio .NET 2003 projects to Web application projects in Visual Studio 2005.
Visual Studio 2005 - ENU Service Pack 1
Just came back from long weekend. Before leaving for the day on Friday, I downloaded and started installation of service pack 1 for VS 2005 professional Edition.
Will update my observations as and when observed :-)
Version of IDE updated-
From - Version 8.0.50727.42 (RTM.050727-4200)
TO - Version 8.0.50727.762 (SP.050727-7600)
New addition to Installed Products-
Microsoft Visual Studio 2005 professional Edition - ENU Service Pack 1 (KB926601)
Two new project type-
ASP.NET Web Application [Already available as a standalone download @ ttp://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx ]
“The Visual Studio 2005 Web Application Project model uses the same project, build and compilation semantics as the Visual Studio .NET 2003 web project model:”
ASP.NET Web Service Application
REST AFTER MORE INSPECTIONS ...
Friday, January 12, 2007
Judiciary Rules here - Says Ninth Schedule Laws Open To Review
The unanimous verdict by the nine-judge constitution bench led by Chief Justice Y K Sabharwal, like the one by the SC on Wednesday in the MPs’ expulsion case, asserted the court’s role as the final arbiter at the expense of the notions of parliamentary supremacy.
In practical terms, it means that many crucial laws, such as the one enacted by Tamil Nadu to extend the quantum of reservations well beyond the supreme court-mandated 50% ceiling, will now be open to challenge in courts on grounds of being contrary to the basic structure as well as violative of fundamental rights—the right to equality (Articles 14, 15 and 16), right to freedom of expression (Article 19) and right to life (Article 21).
The court upheld parliament’s power to put certain laws in the ninth schedule, but that will be of little comfort to politicians who, over the years, have sought to take advantage of the provision—Article 31B, conceived to protect land reform laws from challenges from landlords—to innoculate all sorts of laws from judicial scrutiny. In the most recent instance, the Centre had come under pressure to put anti-sealing laws in the national capital in the schedule.
The TN Reservation Act, which was inserted in the ninth schedule in 1994, will straightaway be examined on the basis of the twin parameters, fundamental rights and basic structure, by a three-judge bench to be constituted later.
What is ninth schedule?
The ninth schedule was drafted by the Nehru government in 1951. It’s a constitutional provision granting parliament the power to insulate any law from judicial review. The provision has come into sharp focus as the political class has tended to use it for all kinds of purposes, most recently for job reservations.
No scrutiny of laws that have passed muster: SC
The supreme court’s decision to put the TN government’s 69% reservations under the judicial scanner is sure to lead to a churning in the political class, with the OBC establishment not concealing its unease over the development. The nine-judge bench, however, was remarkably unanimous as it, in the 108-page judgment, strongly argued that the ninth schedule cannot fetter the court from nullifying laws which fail the twin tests. “The jurisidiction conferred on the supreme court by Article 32 is an important and integral part of the basic structure of the constitution and no act of parliament can abrogate it or take it away...,’’ Justice Sabharwal said, writing the judgment for the bench.
The bench ruled that parliament’s powers to amend the constitution and put laws in the ninth schedule cannot reach such proportions as to bar the court’s powers to test the validity of laws. The court further said that those ninth schedule laws whose validity has already been upheld by the SC cannot be challenged afresh on the basis of Thursday’s order.
Wednesday, January 3, 2007
ECMA International Approves Office Open XML Standard
http://www.ecma-international.org/news/PressReleases/PR_TC45_Dec2006.htm
Microsoft Office Open XML (OOXML) is a specification for a file format for the storage of electronic documents such as memos, presentations, and spreadsheets. The specification was developed by Microsoft and is used in Microsoft Office 2007.
Microsoft's Office Open XML format uses a ZIP container for packaging XML and other data files. The resulting files are smaller than the binary files created by the previous Office formats. Microsoft maintains that its primary goal has to be backward compatibility with existing documents and full support of its extensive feature set. The Microsoft Office Open XML format is Microsoft's direct answer to the OpenDocument format (ISO/IEC DIS 26300) which was created by the OASIS foundation and uses similar technologies (XML contained in ZIP). A comparison can be found in Comparison of OpenDocument and Microsoft XML formats.
Source - http://en.wikipedia.org/wiki/Microsoft_Office_Open_XML
Tuesday, January 2, 2007
Go-Live License for .NET Framework 3.0 Runtime Components V3.0, Release Candidate
http://msdn2.microsoft.com/en-us/netframework/aa663302.aspx
Asynchronous programming
Below link seems to be good enough to start with!
http://msdn2.microsoft.com/en-us/library/ms228969.aspx
Blog Archive
-
▼
2007
(21)
-
►
January
(9)
- Visual Studio 400 Differences
- Web Client Software Factory
- Enterprise Library 3.0 January 2007 CTP
- Comparing Web Site Projects and Web Application Pr...
- Visual Studio 2005 - ENU Service Pack 1
- Judiciary Rules here - Says Ninth Schedule Laws Op...
- ECMA International Approves Office Open XML Standard
- Go-Live License for .NET Framework 3.0 Runtime Com...
- Asynchronous programming
-
►
January
(9)
