Saturday, June 13, 2015

How to remove istartsurf.com from the system or protectservice.exe

iStartSurf is a browser hijacker. iStartSurf it’s technically not a virus, but it does exhibit plenty of malicious traits. It gets installed on your computer after you have installed a freeware software that had bundled into their installation this browser hijacker. To remove this browser hijacker you will need to remove protectservice.exe from your machine.

How to Remove Protectservice.exe Virus

Steps:

1.     Open windows explorer and go to the C:\Program Files\XTab folder. On 64bit machines go to C:\Program Files(x86)\XTab

2.     You will find uninstall exe, run it to uninstall the protectservice.exe from your machine.

3.     After successful uninstall, reset all the browsers (e.g. chrome, ie, firefox). In the IE the option is in the Internet Options->Advance tab. Google for other browser if not sure how to reset.

4.     Now restart your machine.

Saturday, December 11, 2010

How to get Comma Separated Values (CSV) from Table Column

This is another very common requirement while developing sql code for the applications.
And again this can be done in various ways...one of them is here...

Example:

create table user_reports
(id int identity, username varchar(20),report_name varchar(20), report_available bit)
go
insert into user_reports(username,report_name,report_available)
select 'Ajay', 'report1',1
union all
select 'Ajay', 'report2',1
union all
select 'Ajay', 'report3',1
union all
select 'Ajay', 'report4',1
union all
select 'John', 'report5',0
union all
select 'John', 'report6',1
union all
select 'John', 'report2',0
union all
select 'Tony', 'report1',1
union all
select 'Tony', 'report7',1
union all
select 'Ram', 'report3',1
union all
select 'Ram', 'report4',0
union all
select 'Ram', 'report8',1


-- CSV report list for all users
select stuff(
(select ',' + ur.report_name
from user_reports ur
order by ur.report_name
for xml path('')),1,1,'') as 'Report List'
go

-- CSV report list for a given user
select stuff(
(select ',' + ur.report_name
from user_reports ur where username = 'Ajay'
order by ur.report_name
for xml path('')),1,1,'') as 'Report List'
go

-- CSV report list user wise
select ur1.username,stuff(
(select ',' + ur.report_name
from user_reports ur where ur.username=ur1.username
order by ur.report_name
for xml path('')),1,1,'') as 'Report List'
from user_reports ur1 group by ur1.username
go

How to aggregate BIT Columns with Group By in SQL Server

This is a very common requirement in sql when you are deveploping applications.
You can achive this with very simple query, using cast and min sql functions.

Example:

create table user_reports
(id int identity, username varchar(20),report_name varchar(20), report_available bit)
go
insert into user_reports(username,report_name,report_available)
select 'Ajay', 'report1',1
union all
select 'Ajay', 'report2',1
union all
select 'Ajay', 'report3',1
union all
select 'Ajay', 'report4',1
union all
select 'John', 'report5',0
union all
select 'John', 'report6',1
union all
select 'John', 'report2',0
union all
select 'Tony', 'report1',1
union all
select 'Tony', 'report7',1
union all
select 'Ram', 'report3',1
union all
select 'Ram', 'report4',0
union all
select 'Ram', 'report8',1


-- This simple sql query will return user wise aggregated report_available column value
select username as UserName, cast(min(cast(report_available as int)) as bit) as 'Is Report Available'
from user_reports group by username

SSIS Error : Failed to save package file, Element not found.

There could be many reasons that can cause this error but in my case the reason was that MSXML6.dll was not registered on my machine. So I just registered this dll to resolve this error.

To register MSXML6.dll on your machine, follow these steps:
1. From the Start menu, click Run.
2. Enter the following command: regsvr32 %windir%\system32\msxml6.dll.
3. Click OK.

Note - Replace %windir% with the path of windows folder on your machine. I my case it was - c:\windows

Wednesday, June 2, 2010

How to handle errors in APS.NET

There are three ways to handle errors in asp.net application.

1. Using Page class Error even:

You can handle error on every page by define error handler for Page class Error event.
Like-

void Page_Error(object sender, EventArgs e)
{
Response.Redirect("Errorpage.htm");
}

2. By defining error handler in global.asax file

This is better approach than the first one because its a centralize approach to handle errors. Here instead of writing error handler in every web page, you will need to define error handler at application level in the global.asax file.
Like:

void Application_Error(object sender, EventArgs e)
{
Response.Redirect("Errorpage.htm");
}

Note:- Whenever an error occurs application look for error handler at page level and then at application level. So if you have defined error handler in the web pages then it will handle the error not the one defined in global.asax file.

3. By adding customError tag in the web.config file

This is another centralize approach to error handling in ASP.NET. In fact you can redirect to different custom error pages for different error status codes.
Like:

< customErrors defaultRedirect="error.htm" mode="On" >
< error statusCode="404" redirect="notfound.htm"/ >
< /customErrors >

Monday, May 17, 2010

Error: possible soap version mismatch

Sometime you may encounter below mentioned error when you try to access web service in your .net application.

Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/wsdl/ was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.


Actually if you are setting URL property in your .net application with wrong web service url than most likely you may get this error. The general mistake is that people assign same url which they used to see the description of web service (e.g. http://localhost/servlet/webservices?ver=1.1?wsdl) to the URL property of the proxy class instead of the web service url(e.g. http://localhost/servlet/webservices?ver=1.1). So assign the web service url and see if you are able to resolve this error.
If still you are not able to resolve this error then make sure the url you are assigning is correct.

Note: - I have noticed that in case web service is developed in .Net and is consumed by a .Net client then assigning description url (e.g. http://localhost/webservices/service.asmx?wsdl) does not generate this error. But if the web service is developed with non .net technology and generates WSDL that is somewhat different from what .Net clients expect then this error will most likely come up in that case try above given solution.

Tuesday, May 11, 2010

Error: A semi colon character was expected. Error processing resource

Very often people encounter this error when they try to open xml file in IE or try to load it in their code. The most common reason for this error is that your xml file may be containing "&" character. Actually IE misunderstands "&" character with some HTML code that starts with "&" and ends with ";" character like-& nbsp ; means non-breaking space and rendered as a white space.

For Example: here is the content of an xml file which will give this error due to "&" character in the url.

< ?xml version="1.0" encoding="utf-8" ? >
<>
<>
< name="WSACCPURL">
<>http://localhost/Test/webservices?ver=1.1&wsdlxml< /value >
< /setting >
< /appSettings >
< /configuration >

So to resolve this error I replaced the "&" character with HTML code phrase "& amp ;"
Note:- Ignore the space between & and ; there should not be any space. Here I had to give space to avoid their special meaning by IE.

Now the updated xml file is:

< ?xml version="1.0" encoding="utf-8" ? >
<>
<>
< name="WSACCPURL">
<>http://localhost/Test/webservices?ver=1.1& amp ;wsdlxml< /value >
< /setting >
< /appSettings >
< /configuration >


Now when this file is opened in IE the & amp ; is rendered as & character.