Monday, October 26, 2009

DataReader and Dataset

In one of the project that I was working on there was a Time Out exception happened while navigating through lot of records. It was causing the whole application to crash. While examinig the application closely and running the sql profiler and using the below query to get all the processes that are active or getting created.

Query Analyzer:

EXEC SP_WHO2

SELECT [sql_handle],stmt_start,stmt_end,loginame,[program_name],hostname,* FROM MASTER..SYSPROCESSES WHERE [program_name]='.Net SqlClient Data Provider' ORDER BY SPID DESC

SELECT * FROM MASTER..SYSDATABASES
SYSDATABASES will give the database name that is being used.

SQL Profiler:

In the Sql profiler we can examine for which database and for what processes the queries are executed.

***********************************************************************************

While closely examining the code I found out that the datareader was cauing the issue. And also I noticed that the sp_reset_connection Stored procedure was not getting called after the datareader performed its operation.
Changing this to dataset really resolved the issue and unnecessary connection was not getting opened and also sp_reset_connection was getting called.

Sunday, October 25, 2009

Bin Scope Binary Analyzer: Mini Fuzz Tool

Bin Scope Binary Analyzer:

The BinScope Binary Analyzer is a Microsoft verification tool that analyzes binaries to ensure that they have been built in compliance with Microsoft’s Security Development Lifecycle (SDL) requirements and recommendations. BinScope checks that SDL-required compiler/linker flags are being set, strong-named assemblies are in use, and up-to-date build tools are in place. BinScope also reports on dangerous constructs that are prohibited or discouraged by the SDL (e.g. read/write shared sections and global function pointers).
This below article has a small demonstration video.

http://blogs.technet.com/security/

It can be run standalone or integrated with the VS IDE.

Download:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=90e6181c-5905-4799-826a-772eafd4440a


Mini File Fuzzer:


A testing technique that can help find denial of service and security vulnerabilities in software.

Technique:
1. Force application to malformed data.
2. If crash occurs, identify where and how.
3. File a security bug.
4. Investigate underlying code for security risk.

This below article has a small demonstration video.
http://blogs.technet.com/security/

Download
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=b2307ca4-638f-4641-9946-dc0a5abe8513