Sunday, February 18, 2007

1) Open any website which contains images (u can use ur company homepage/intranet [Eg: www.orkut.com])

2) Copy below given code and paste on the Address bar of the same browserwindow and press enter.....

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300;y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; functionA(){for(i=0 ;i<=dil; position="'absolute';DIS.left=" dis="DI[" top="Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5);void(0)

And see the magic….




Sunday, February 04, 2007

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.



Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.



Solution :

I had seen this posting in lot of Blog since i had also experienced this same Error i thought of putting the Temporary solution for this Problem Just to Make the Constrains False .this Depends on your requirement . By making the [Dataset.EnforceConstraints=false;] this Problem can be solved



Saturday, February 03, 2007

Things to be consider while creating a Data base

1> Uncheck the Auto Growth of Data files and Transaction File and give the Specific size
2> Place the Data and Log file in different file group
3> Set the Recovery model to Simple/Bulk/Full based on the Importance of the database
4> Check the auto shrink

Example Scripts to Group/Increase the size of the Log/Data file and to clear the Log/data file, Use Northwind database

--
-- TO SRINK THE DATA or LOG FILE
--

USE Northwind;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE Northwind
SET RECOVERY Simple;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (Northwind_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE Northwind
SET RECOVERY FULL;
GO

---------------------------------------------------------------------------------------------

--
-- TO INSERT MORE RECORD TO DATA BASE
--

declare @iCount int
set @iCount=0

MyLoop1:
insert into employees (
LastName,FirstName,Title,TitleOfCourtesy,BirthDate,HireDate,Address,
City,Region,PostalCode,Country,HomePhone,Extension,Photo,Notes,ReportsTo,PhotoPath)
values('Test','Test','Test','Test','1948-12-08 00:00:00.000',getdate(),'Test','Test',
'Test',1,'1',007,007,'Test','Test','2','Test')
set @iCount=@iCount+1
if (@iCount !=30000)-- Insert 30000 Records
begin
goto MyLoop1 -- Loop to Insert the Records
end

---------------------------------------------------------------------------------------------
-- SELECT THE RECORD
select EmployeeID, LastName,FirstName,Title,TitleOfCourtesy,BirthDate,HireDate,Address,
City,Region,PostalCode,Country,HomePhone,Extension,Photo,Notes,ReportsTo,PhotoPath from employees


-- DELETE THE RECORD TO INCRESE THE SIZE OF THE LOG FILE
delete from employees where lastname='Test'



---------------------------------------------------------------------------------------------
-- SELECT STORED PROCEDURE
Create Procedure Sample_Emp_Sel_Employees
as
select EmployeeID, LastName,FirstName,Title,TitleOfCourtesy,BirthDate,HireDate
from employees
Go
-- EXECUTE SP
exec Sample_Emp_Sel_Employees

Saturday, January 27, 2007

Using SqlHelper in .NET application. The SqlHelper Class is present in the Microsoft.ApplicationBlocks.Data.dll . Which is free download application released from Microsoft ( http://download.microsoft.com/download/VisualStudioNET/daabref/RTM/NT5/EN-US/DataAccessApplicationBlock.msi) .After Installation compile the Application which is found in Start-->Microsoft Application Blocks for .NET -->DataAccess --> and select your application.
and build it and Dll will the generated in the Bin folder make it as referance in your application .the example for the Application is in http://aspnet.4guysfromrolla.com/articles/070203-1.aspx
101 Samples for C#.net

http://www.microsoft.com/downloads/details.aspx?familyid=08e3d5f8-033d-420b-a3b1-3074505c03f3&displaylang=en

Monday, August 14, 2006

Some usefull Link for OOPS

1. OOPS Part I
http://www.c-sharpcorner.com/Code/2005/June/OOPSand.NET1.asp
2. OOPS Part II

http://www.c-sharpcorner.com/Code/2005/June/OOPSand.NET2.asp
Improving .NET Application Performance .This Link Gives you a Wonderfull Document from Microsoft .
http://www.microsoft.com/downloads/details.aspx?familyid=8A2E454D-F30E-4E72-B531-75384A0F1C47&displaylang=en
The main impact on Performance and Scalalility of the .Net application are

Memory Misuse
Resource Cleanup
Improper use of threads
Abusing shared resources
Type Conversions
Misuse of Collections
Inefficeient Loops