December 03, 2011

TCP IP connection Failed Address already in use

The TCP/IP connection to the host , port 1433 has failed. Error: "Address already in use: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port

Type: SQL server exception when used with ms jdbc drivers

Drivers: JDBC (sqljdbc4.jar, sqljdbc.jar) from microsoft

Solutions:
Solution 1:

In my problem i was not using JDBC pool, in configuration when i add the node for pool. after restarting the application it started working for me.

In my case error occurred in Tridion CMS.

Solution 2:
Go to: SQL Server Configuration Manager -> Protocols for SQL SQLEXPRESS,
then select Properties of TCP/IP. 
In the tab IP Addresses, set the TCPPort in section IPAll to 1433.

November 27, 2011

This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default

This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".



1) First go to following location
    C:\Windows\System32\inetsrv\config
2) Open the application "applicationHost.config"



Go to<sectionGroup name="system.webServer">
in  this node


Set every section's overrideModeDefault="Allow"


or particular node if you know which on is giving issue


<section name="handlers" overrideModeDefault="Deny" />

Asp.net MVC requested page cannot be accessed because the related configuration data for the page is invalid.



HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.


Description: i got this error when i tried to deployed the asp.net mvc application on the IIS 7.5. As IIS 7.5 is very different from IIS 6.0 some setting also differ.
It was working perfectly on IIS 6.0

System Configuration on which this error occurred

Windows 7 64 bit
IIS 7.5
Asp.net 2.0/3.5 with MVC 2,3


Solution: it worked for me, it may also work for you.


Go to browser, on error page check the section "Config Source"


you will find error in specific section.
for example my error was


<system.webServer>
 <handlers


do following as per your error 

1) first go to following location
    C:\Windows\System32\inetsrv\config
2) Open the application "applicationHost.config"


go to particular section in my case


<sectionGroup name="system.webServer">
  <section name="handlers" overrideModeDefault="Deny" />


Change overrideModeDefault="Allow"

3) Reset IIS 


You may also have to perform following in addition to above step. but following steps are optional. 


b)  Set application pool to 32 bit:
  • Open IIS, 
  • Select application pool option, 
  • Now on right side select the desired app pool, 
  • Now on right side bar. select option: "Advanced Settings..." 
  • There is option "Enable 32 bit application" set it to true:
  • Now press ok.., Reset IIS
c) Set "managed pipline mode" to Classic:
if step a does not work. perform following.
  • Double click the application pool
  • select classic in  "managed pipline mode" option.

asp-net MVC HTTP Error 403-14 - Forbidden

Asp.net MVC Error: HTTP Error 403.14 - Forbidden 
The Web server is configured to not list the contents of this directory.

OR

A default document is not configured for the requested URL, and directory browsing is not enabled on the server, 

Description: i got this error when i tried to deployed the asp.net mvc application on the IIS 7.5. As IIS 7.5 is very different from IIS 6.0 some setting also differ.
It was working perfectly on IIS 6.0

System Configuration on which this error occurred

Windows 7 64 bit
IIS 7.5
Asp.net 2.0/3.5 with MVC 2


Solution: it worked for me, it may also work for you.

a)  Set application pool to 32 bit:

  • Open IIS, 
  • Select application pool option, 
  • Now on right side select the desired app pool, 
  • Now on right side bar. select option: "Advanced Settings..." 
  • There is option "Enable 32 bit application" set it to true:
  • Now press ok.., Reset IIS

b) Set "managed pipline mode" to Classic:
if step a does not work. perform following.
  • Double click the application pool
  • select classic in  "managed pipline mode" option.



 

November 26, 2011

Enable Basic Authentication in IIS 7.5, option not visible

Enable Basic authentication in IIS 7.5 version. In previous version 6.0 it was easily available and used.

How to enable basic authentication in Internet information services 7 / 7.5


There are two ways to enable basic authentication in 7
1)  Enable authentication in control panel


a) Open control panel
b) click on Programs and Features
c)  click on Turn Windows features on off.. wait it may take some time to load...
d)  select Internet information services. expand it via clicking on + plus sign
drill down further... like in following snapshot.






















Select Basic authentication like in picture and press ok.
e) Restart   IIS.. open command prompt with admin permission., type iisreset and enter..
or directly open the iis via typing inetmgr in run. and right click on iis icon in right top.. select stop... after that again right click on iis icon.. now select start

2) second way to enable the basic authentication:

Open command prompt with admin rights.

a) type cd
b) type c:
c) type cd %windir%\system32\inetsrv
d) type appcmd set config /section:basicAuthentication /enabled:true

press enter after each step.

November 09, 2011

How to know Which Sql server version / service pack installed

Sql server has some cryptic nos to know the what version of sql server and what service pack is actually installed on your machine.

To to Sql server management studio on the machine where sql server is installed
click help/about. and match the version from below list.

or Run ...> regedit....> HKLM -> software-> microsoft.>.mssqlserver..>. currentversion

RTM (Gold, no SP)SP1SP2SP3SP4
 SQL Server 2012
     codename Denali
-
 SQL Server 2008 R2
     codename Kilimanjaro
10.50.1600.110.50.2500
 SQL Server 2008
     codename Katmai
10.00.1600.2210.00.253110.00.400010.00.5500
 SQL Server 2005
     codename Yukon
9.00.1399.069.00.20479.00.30429.00.40359.00.5000
 SQL Server 2000
     codename Shiloh
8.00.1948.00.3848.00.5328.00.7608.00.2039
 SQL Server 7.0
     codename Sphinx
7.00.6237.00.6997.00.8427.00.9617.00.106


referenced from sqlserverbuilds.blogspot.com

October 21, 2011

Bad Request (Invalid Hostname) on web application

Recently i was working on an Tridion application, Tridion is CMS (Content Management System) which got very good feature for multilingual site.
Anyways i got this error multiple times
Reason of error:

1) Application pool was not started (Defaultapppool or any pool)
Just start the application  pool, set the appropriate .net framework
2) you have put some value in  header value in

check following screen shot
Just press edit  and remove any value from the "Host Header value"
it will start working.

if it resolve your issue. Please comment below.


October 07, 2011

Advice: Jobs for Freshers, engineering students, MCA


Struggling for job in IT

here are few tips which may help you.

1) Get contacts of your college Alumni, so have friendship with your seniors in college, go to Training & placement officer and ask for numbers.

2) Try contacts from your relative who may be working somewhere.

3) To get placement in small company (8-25) employee company, you should have working knowledge of asp.net, c#, SQL. Develop a website on e-commerce. it will explore different aspects of asp.net

4) Try through some HR Agent. they can put you in some company based on some contract, thing is you just need a break. so get into whatever company is it and start getting experience as well as motivation. after getting experience of 1 year. you can try another company. Min 1 year is needed. now at 1 lots of small company hires, but less small companies.
after completing 2 years ocean of jobs opens to you. MNCs majorly hires people of 2 years experience.

5) If you want only big companies as your comm-skills and analytical skills are good. you can give a try to C-DAC course. A lot of middle level companies hire at C-dac centers.

if you need any kind of help in above steps or any other just comment below. i will try to answer ASAP.

October 06, 2011

.net certification for Freshers and College-Passouts

I often get a lots of comments about .net certification for fresh college pass-outs/ Freshers. Some Freshers gets placement but remaining wanted to do some additional study certification so have edge for job.
                                                But as per Microsoft you need to have at least 2 years of industry experience to do the certification which actually do not verified by Prometric Center in India, but when Microsoft says 2 years of experience it means exams require some practical industry hands-on.

1)  If you have good knowledge of .net at fresher level means you have done very good training at college level and executed some projects then, you can give a try,

2) But if you want to sit for exam just on basis of certification dumps, please do not go for it. Get some experience on it, because interviewer will know that you are not genuine & you will face rejection another set back for you that despite of certification you are unable to crack any interview.

Summary is give it try after getting some industry experience.

if you struggling for job read my article. Jobs Advice for Freshers






September 25, 2011

Debug XSLT XSL transformation in Visual studio.

In Visual studio XSLT transformation can be performed and debugged in very nice way, i come to know this feature when my altova Xml spy license was expired and i was searching desperately for a tool which can show me live transformation ie. debugging. It is best alternative to Altova XML SPY if you already have VS license.

Steps to debug xsl transformation.

1. Open Visual studio 2010.
2) Do not create any project or file, Just drag xml file and xslt file into the Visual studio.
3) Now place break-point in the xslt file.
4) Press Alt+F5 or alternatively select from menu debug->"start XSLT debugging"
5) It will open dialog box and ask for xslt file, just select the xslt file( i know you have already opened it , but do it )
6) Now transformation has been started , you will see the debug point has been hit.
7) Now press F5 to complete the transformation, 
8) Out will be shown either adjacent to XML or XSLT file

Visual studio 2010, alternative to Altova XML Spy

August 08, 2011

Dot net certification Books, Dump, study Material for 3.5 and 4.0

Books are the best practice material for the preparation for .net certification, currently only 3.5 and 4.0 certification are valid. 2.0 has expired in June-2011,

if you are already 3.5 then you must give upgrade exams. if you are new then choose only 4.0 certification , because 3.5 will expire next year. as new framework is on the way.

Books for .net Certification: 


4.0 Exams
Exam name : 70-511


MCTS Self-Paced Training Kit (Exam 70-511): Windows® Application Development with Microsoft® .NET Framework 4

Exam name : 70-515

MCTS Self-Paced Training Kit (Exam 70-515): Web Applications Development with Microsoft® .NET Framework 4

Exam 70-513 
Windows Communication Foundation Development with Microsoft .NET Framework 4

Exam name :Exam 70-516


MCTS Self-Paced Training Kit (Exam 70-516): Accessing Data with Microsoft® .NET Framework 4




Exam 70-506
Silverlight 4, Development


MCPD:


Exam:70-518: PRO: Designing and Developing Windows Applications Using Microsoft .NET Framework 4

Exam 70-519: PRO: Designing and Developing Web Applications Using Microsoft .NET Framework 4


Exam 70-583: PRO: Designing and Developing Windows Azure Applications

An existing connection was forcibly closed by the remote host in .net app

Sometime "An existing connection was forcibly closed by the remote host" occurs in web app to the user, its very strange issue because all module were working yesterday they suddenly stopped working.

Resolution:

1) Reset the IIS, but it will affect all the application on IIS , if multiple sites are hosted. if only single site then open the command prompt with admin rights and type IISReset and enter.

or

2) Restart the default/Required WebSite

3)  Recycle the Application pools

4) Restart any dependent windows service.

if any comment/issue please comment.

August 01, 2011

The server has rejected the client credentials in WCF


"The server has rejected the client credentials"

i have a WCF serviec which is running on my localhost on 9876 port.

i was using nettcp protocol for my WCF windows service, and in client(from which you are hitting the service, say another website or another web service)it was having following entry in config file

<client>

<endpoint address="net.tcp://Something:9876/RajService"

 binding="netTcpBinding" bindingConfiguration="TCPBinding_abc"

 contract="RService.IR" name="RS" />

</client>

the problem here is instead of localhost (or where my service is actually pointing) 

i was using "Something" and "Something" do not have any entry in the host file.

i changed it to localhost:9876 and this error was resolved.

July 18, 2011

SSRS special character issue in Html/CSV download, UTF-8

Special character means other than ASCII it could be French/Spanish etc. Sometime while working simple mistake cause this special character issue, special character appears as "?" or some other character.

This happens when special characters are not treated specially, for special character we should use UTF-8 encoding rather then ASCII.
SQL Server Reporting service there are option of Html and csv (download).


byte[] result = null;
                string format = @"CSV";
                string devInfo = null;
                string encoding;
                string mimeType;
                string[] streamIDs = null;
                string historyID = null;
                Warning[] warnings = null;
                ParameterValue[] reportParameters = null;
                ReportData reportData = null;

1) line to be updated
devInfo =  @"True";
rather than following.....
                    //devInfo = @"ASCII";
2) reportData.ReportOutData = Encoding.UTF8.GetString(result);
rather than
reportData.ReportOutData = Encoding.ASCII.GetString(result);


3) //Save CSV if (its csv)

File.WriteAllText(file, header+Output, Encoding.UTF8);
//header because in devInfo we have set it to NoHeader, so manually we need to set  it.

it will sure resolve the issue

Comment if it resolve/not-resolve the issue

June 22, 2011

DataGrid GridView custom control rendering rules="all" attribute, Firefox/Internet explorer showing border

DataGrid or GridView  or custom control rendering rules="all" attribute.

Grid shows border on Firefox but not on internet explorer.

Little solution:
Set
GridLines = "None"

now Grid view rendered table will look same on both IE and ff. and this attribute rules will not be rendered.


May 26, 2011

Dot Net Certification framework 3.5 to 4 upgrade Details: Microsoft 70-521,70-522

New Framework, New Certification. I guess Developers are designated to be punished:).
Anyways Article is about .net 4 certification.


Certification of framework 3.5 will be in next 1 year.
Framework 5.0 is underway.


So if you want to go for any .net certification it should be 4.0


if you are earlier certified developer you need to go through upgrade exam.


Upgrading from MCPD 3.5 Certification to MCPD 4.0


MCPD are of two types.
1)MCPD Web
2) MCPD Windows.


One exam Required




 MCPD: Web Developer -> Those who wanna do web MCPD


 MCPD: ASP.NET Developer 3.5 or MCPD Enterprise Application Developer 3.5  -> Exam 70-523:  Upgrade: Transition Your MCPD .NET Framework 3.5 Web Developer Skills to MCPD .NET Framework 4 Web Developer


MCPD: Windows Developer -> Those who wanna do Window MCPD


MCPD: Windows Developer 3.5 or MCPD: Enterprise Application Developer 3.5  ->  Exam 70-521: Upgrade: Transition Your MCPD .NET Framework 3.5 Windows Developer Skills to MCPD .NET 4 Windows Applications Developer


Recommended Read:

.Net Certification framework 2 to 4 upgrade Details: Microsoft 70-521,70-522,70-566,70-567.

.Net certification Framework 4: 70-511 70-515 70-513 70-516 70-506 70-518 70-519 70-583




Dot Net Certification framework 2 to 4 upgrade Details: Microsoft 70-521,70-523,70-566,70-567

New Framework, New Certification. I guess Developers are designated to be punished:) with these upgrades

Anyways Article is about .net 4 certification.

Certification of framework 2.0 is retiring this june 2011.
Certification of framework 3.5 will be in next 1 year.
Framework 5.0 is underway.

So if you want to go for any .net certification it should be 4.0

if you are earlier certified developer you need to go through upgrade exam.

Upgrading from MCPD 2.0 Certification to MCPD 4.0


Two exams Required


 MCPD: Web Developer


1.) MCPD: Web Developer 2.0   ->  Exam 70-567: Upgrade: Transition Your MCPD Web Developer Skills to MCPD ASP.NET Developer 3.5


    Comment: After above exam you are : 
                     a) MCPD: Web Developer 3.5
                     b) MCTS: .NET Framework 3.5, Web Applications


now you need another exam to convert MCPD 3.5 to MCPD 4.0


2.) MCPD: ASP.NET Developer 3.5 or MCPD Enterprise Application Developer 3.5  -> Exam 70-523:  Upgrade: Transition Your MCPD .NET Framework 3.5 Web Developer Skills to MCPD .NET Framework 4 Web Developer


MCPD: Windows Developer


1) MCPD: Web Developer 2.0  -> Exam 70-566: Upgrade: Transition Your MCPD Windows Developer Skills to MCPD Windows Developer 3.5



 Comment: After above exam you are : 
                     a) MCPD: Windows Developer 3.5
                     b) MCTS: .NET Framework 3.5, Windows form Applications

now you need another exam to convert MCPD 3.5 to MCPD 4.



2.) MCPD: Windows Developer 3.5 or MCPD: Enterprise Application Developer 3.5  ->  Exam 70-521: Upgrade: Transition Your MCPD .NET Framework 3.5 Windows Developer Skills to MCPD .NET 4 Windows Applications Developer



May 25, 2011

Error 1053: The service did not respond to the start or control request in a timely fashion.

Error 1053: The service did not respond to the start or control request in a timely fashion.
linked server
Some times you get this error while starting or restarting the windows service especially in .net wcf window service.
Two reason for this error
1) Config file of windows service has some issue. clearly check it for
a) Unclosed Tags
b) any xml comment error
c) any character not allowed in like. any character without tags.

2) the new code you wrote has some issue. Like on start of service you call a method, which do some action like read a file or anything which throw some exception.

in these scenarios service did not start error can occur.

You can also try once or thrice before checking above steps. because sometime resource allocation can cause this issue.
at last restart you system and try :)

if it solve your problem comment with what kind of issue it was.

Move / svn-move file to another folder in TortoiseSVN: How


If you want to move some files from one folder to another in Tortoise SVN. You should not do normal cut paste, or delete, then add new. It will delete the Version history associated with the SVN. so do the SVN move.

  1. Select the files you wish to move.
  2. Right click and drag the files to destination folder
  3. A window will popup appear like following. Click "SVN Move versioned item(s) here"

The C# ?? null coalescing operator on value and reference type


In C#  "??" operator is known as null coalescing operator. It can be used on both nullable value type &  reference type.
?? operator checks if  the value provided on the left side of the expression is null, it returns value on right side of the expression. if its not null it return the value of the left.
Q. how the value type will have null.
A. With nullable type. int? a = null;

Example 1:
string str = null;
string output = str ?? "Punjab";
------------------------------------
output = "punjab"
because str is null, 
--------------------------------------
Example 2.
string str = "Punjab";
string output = str ?? "Delhi";
------------------------------------
output = "punjab"
because str is not null, 
--------------------------------------

Example 3.
int test?=null
int output = test ?? 164;
------------------------------------
output =164
because test is null, 
--------------------------------------

May 21, 2011

Three mistakes of Steve Jobs life : Rise of Microsoft

Three Mistakes of Steve Paul Jobs, Which caused Rise of Microsoft as largest software vendor, now windows has eighty percent of monopoly and large base of developer who develop for Windows.

1) Macintosh's Prototype to bill gates: Apple firstly invent LISA then created a MAC and mistakenly displayed that to Bill Gates. Bill Gates saw future in the MAC, as Microsoft was also pursuing interest in OS but their team  failed to create such impressive GUI like MAC, Bill Gates persuaded Jobs to give him the prototype via showing   big dreams, He said to  Jobs that Microsoft will create software for MAC. Jobs could not see ill will of Bill as that time Microsoft was very small as compared to Apple. But he realized his mistake very soon when he launched Windows with GUI.

2) Mac Cloning: Apple started give rights to clone the mac via ROM chips only in 1995, ROM chips contains MAC os APIs etc. Any manufacture can create a clone of MAC via using the licensed ROM chips from MAC. Motorola and many other created bit expensive clone of MAC. On returning back to Apple, Steve stopped this business.
                   Had the apple started it in 80s, they could have hold on developer community, Which develop software for windows, real power of MS. Apple do have developer community but not that much, including IOS developers.

3) Over-priced MAC: Apple is now most valuable company in technology after success of IOS devices and App Store, they are getting developer community now, But mac seems over-priced, if they still want more developer they should reduce the price of mac. Windows machine cost around 15-20k, and Notebook starts around 25k. MAC is almost double price though hardware configuration is higher, if we compare same configuration machine price then diff of 150-200$. but that comes for price of style, but not all want style. apple should reduce its prices by $100.
                                They already have captured mobile market, but to get the desktop community above is very required
 
4) He did not take Cancer seriously and choose medicines rather than operation. He might be alive today, if have chosen operation on medicines

April 28, 2011

There is no Unicode byte order mark. Cannot switch to Unicode

Issue: {There is no Unicode byte order mark. Cannot switch to Unicode}

Reason:  Data/xml/text is in different encoding & you are trying to read/process it in different encoding.


Steps: it can occur with Microsoft .net application, asp.net mvc or any java, php applicaiton.


Just confirm that. if you are reading a stream or file, explicitly specify the encoding rather that rely on default encoding select by CLR. 
You may have to put some more lines in the code because some time the method you are using does not have parameter for that. so you have to go additional step to provide stream which is having that parameter and supply it.


Example: 


Default: 


XmlSerializer xs = new XmlSerializer(typeof(T)); return (T)xs.Deserialize(reader);


Explicitly:


XmlSerializer xs = new XmlSerializer(typeof(T)); MemoryStream memoryStream = new MemoryStream(StringToASCIIByteArray(xml)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.ASCII); return (T)xs.Deserialize(memoryStream);