Friday, October 14, 2011

SSRS DB is properly working but SSRS webservice url is giving 500 error.

Check event view entry and if u find below entry:-

Message: The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\RSTempFiles\'.

Solution :- Assign Full Control to NETWORK SERVICE user account for this folder C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\RSTempFiles\

Friday, September 9, 2011

Fancy box and mvc's action result

Hi,

I faced issue with asp.net mvc. The images
I'm using are stored in a database. They are served from the server
using ASP.NET MVC 3. Therefore, my image links look like this:
<a href="/Photo/Image/4" rel="gallery"><img src="/Photo/Image/4"
alt="foo" /></a>

The fancybox script uses regex to determine if the link is an image.
Well, it fails on this, and winds up showing you the raw data in the
image file. I figured out what to do by reading the javascript. All I
needed to do was add 'type': 'image' to my options. My script looks
like this:
$(".gallery a").fancybox({
'zoomSpeedIn': 300,
'hideOnContentClick': true,
'zoomSpeedOut': 300,
'overlayOpacity': .8,
'type': 'image'
});

JQuery Fancy box

http://fancybox.net/

Wednesday, September 7, 2011

Check no of open connection in SQL server

--> To allow users to view current activity on the database:
sp_who2

--> To give you the total number of connections per database on a database server:

SELECT DB_NAME(dbid) as 'Database Name',
COUNT(dbid) as 'Total Connections'
FROM master.dbo.sysprocesses WITH (nolock)
WHERE dbid > 0
GROUP BY dbid

--> To get the dbid from database name
SELECT DB_ID('MyDBName') as [Database ID]

--> To give you the process Ids of existing connections in the database (not necessarily open but existing):
SELECT spid
FROM master.dbo.sysprocesses WITH (nolock)
WHERE dbid = (SELECT DB_ID('MyDBName') as [Database ID])

--> To give you information about the actual process id (replace 1018 with the spid):
dbcc inputbuffer (1018)

--> To kill a process
kill 1018

Friday, August 26, 2011

TCP/IP Application

Below is link for sample application

http://www.dijksterhuis.org/building-a-tcpip-server-using-c/

It will give you amazing startup code in TCP/IP Communication.

If you are able to connect to the local machine via telnet command not able to connect from another machine then make sure to add exe and port into exception.

Friday, July 8, 2011

Temp table insert with sp_executesql

DECLARE @jobs TABLE
( jobcount int
)
INSERT
INTO @jobs
EXEC
sp_executesql
N’select 1 AS jobcount’
SELECT
*
FROM @jobs

Tuesday, July 5, 2011

How to recover suspect SQL server 2008 Database

DBCC CHECKDB (’YourDBname’) WITH NO_INFOMSGS, ALL_ERRORMSGS

Then run below query

EXEC sp_resetstatus ‘yourDBname’;
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb(’yourDBname’)
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (’yourDBname’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER

Tuesday, June 21, 2011

SC command - Access denied

http://kevin.vanzonneveld.net/techblog/article/allow_windows_users_to_restart_service/

Friday, March 25, 2011

folders are hidden in pen drive

1. click start>>run>>type in "cmd"
2. type the location of your flash drive.. e.g. "d:", "e:", "f:", etc..
3. type "dir /ah"
*you will now see the files/folders with hidden attributes
4. type "attrib [name of file/folder] -r -a -s -h"
*if you're going to unhide files, you should type the whole name plus the extension (format).. example "attrib party.jpg -r -a -s -h"
**if you have folders with 6 characters and above, type the first 6 characters then "~1".. example for folder named "birthday"
"attrib birthd~1 -r -a -s -h"
5. you should repeatedly type dir /ah after unhiding some files/folders so you'll know if they're now working or not..
6. now check you flash drive.. it should be there..

Sunday, March 13, 2011

Jquery Auto complete plugin

$("#txtSearch").autocomplete("/test/searchitembyCode",{ matchCase: false ,
parse: prep_data,
formatItem: function(item) {
return item.Title;
}
}).result(function(event, item) {
alert(item.Id);
});



// Handle data from ajax request
prep_data = function(data){
tmp = eval('(' + data + ')');
parsed_data = [];
for (i=0; i < tmp.length; i++) {
obj = tmp[i];
// Other internal autocomplete operations expect
// the data to be split into associative arrays of this sort
parsed_data[i] = {
data: obj ,
value: obj.Id,
result: obj.Title
};
}
return parsed_data
}