Sunday, August 31, 2008

3 tier Architecture

In 3-tier architecture the system is composed of three layers. The bottom layer is abstracted as data layer. The middle layer is business layer and the top layer is presentation layer.

Flow is like this
Presentation Layer -> Business Layer -> Data Layer -> Data Store

Saturday, August 30, 2008

Marathi

Common Words In Marathi

English Marathi
I Me
You Tumhi / Tu
Please Krupaya
right/Ok Bara / Theek
Yes Ho / Hoy
No Nako
Boy Mulga
Girl Mulgi
Small Lahaan
Big Motha
Fast/Hurry Lavkar
Slow Halhu
Mane Purush/Manoos
Ladies Stree / Mahila
Good/Fine Changla/Mast
Bad Vaiet
Come Yaa
Go Jaa
Here Ikde
There Tikde
We Aamhi
They Tey
Mine Maje
Yours Tumche
Mother Aai
Father Vadil

Numbers
One Ek
Two Doan
Three Teen
Four Chaar
Five Pach
Six Saha
Seven Saat
Eight Aath
Nine Nau
Ten Daha
Eleven Akra
Twelve Bara
Thirteen Tera
Fourteen Chauda
Fifteen Pandhra
Sixteen Solha
Seventeen Satra
Eighteen Athra
Nineteen Ekonees
Twenty Vees
Thirty Tees
Forty Chalis
Fifty Pannas
Sixty Saath
Seventy Sattar
Eighty Ainshi
Ninety Nouvadh
Hundred Shambhar
Thousand Hazaar


Days
Monday Somwar
Tuesday Mangalwar
Wednesday Budhwar
Thursday Guruwar
Friday Shukrawar
Saturday Shaniwar
Sunday Raviwar

Period Of Day
Morning Sakal
Evening Sandhyakaal
Night Ratra


Back Maage
Time Vel
Front Pudhe
Today Aaj
Inside Aat
Tomorrow Udya
Outside Baher
Week Aathawada
Up Var
Month Mahina
Down Khali
Year Varsh
Left Dava
Yesterday Kaal
Right Ujava
Dawn Pahaat
Center Madhye
Mid Night Madhya Ratra
East Purva
North Uttar
West Paschim
South Dakshin
Brother Bhau
Sister Bahin

Where kothe
Is aahe
How kiti
Come Here ikade ya
Return parat
your tumche
name naav
what kai
thanks dhanyavaad
help madati
give dya
price bhav
do kara
reduce kami
call bolva
understand samja
wait/stop thamba
dit basun/basa

Friday, August 29, 2008

Create Trigger To Log DDL Events

CREATE TRIGGER [trgLogDDLEvent] ON DATABASE
FOR DDL_DATABASE_LEVEL_EVENTS
AS
set nocount on
DECLARE @data XML
SET @data = EVENTDATA()
IF @data.value('(/EVENT_INSTANCE/EventType)[1]', 'varchar(100)')
<> 'CREATE_STATISTICS'
INSERT INTO DdlLog..ChangeLog
(
EventType,
ObjectName,
ObjectType,
tsql
)
VALUES (
@data.value('(/EVENT_INSTANCE/EventType)[1]',
'varchar(100)'),
@data.value('(/EVENT_INSTANCE/ObjectName)[1]',
'varchar(100)'),
@data.value('(/EVENT_INSTANCE/ObjectType)[1]',
'varchar(100)'),
@data.value('(/EVENT_INSTANCE/TSQLCommand)[1]',
'varchar(max)')
) ;


ENABLE TRIGGER [trgLogDDLEvent] ON DATABASE

Thursday, August 28, 2008

Color particular row in DataGrid

protected void DataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
{

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemIndex != -1)
{
e.Item.BackColor = System.Drawing.Color.LightYellow;
}
}

Wednesday, August 20, 2008

Trigger

A trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server.
There are two (2) types of triggers in Sql Server 2005 DDL (Data Definition Language) and DML (Data Manipulation Language).
DDL is new in Sql Server 2005.

Syntax to create trigger:

CREATE TRIGGER trigger_name

ON { ALL SERVER | DATABASE }

[ WITH [ ,...n ] ]

{ FOR | AFTER } { event_type | event_group } [ ,...n ]

AS { sql_statement [ ; ] [ ...n ] | EXTERNAL NAME < method specifier > [ ; ] }


When you want to fire the trigger on table level you have to use DML triggers. DML triggers can be on INSERT,UPDATE,DELETE command. While DDL triggers can be used when you want to execute at the time of table,procedure,trigger,function's events like creation , alteration , drop.

Stored Procedure

Syntax to create Stored Procedure.

CREATE PROCEDURE
-- Add the parameters for the stored procedure here
<@Param1, sysname, @p1> = ,
<@Param2, sysname, @p2> =
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
END


Example :
Suppose there is a table StudentMast Having three fields Roll,Name,Address. I want to make an SP(i.e stored procedure) which will take one parameter and finds records which have name = the parameter.


CREATE PROCEDURE Find_Student_By_Name
@Name Varchar(50) ---This is a parameter
AS

BEGIN
Select *
From StudentMast
Where Name=@Name
END

Only Numbers In Text Box In Vb.Net Windows Based Application

Write this code in the KeyPress event of the text box which you want to accept only numeric values.
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = False
ElseIf Asc(e.KeyChar) = 46 Then
e.Handled = False
Else
e.Handled = True
End If

What is fringe benefit tax? What is FBT ?

Fringe Benefit Tax is tax paid by employer after giving any begefit to its employee. Suppose you are working in acompany and the company is giving you the benefit in travelling to your native place from the company location. This benefitwill be under Fringe Benefit Tax and employer have to pay FBT to goverment according to the financial periods rate of FBT.

The purpose for which employer will have to pay FBT.

(a) entertainment;

(b) festival celebrations;

(c) gifts;

(d) use of club facilities;

(e) provision of hospitality of every kind to any person whether by way of food and beverage or in any other manner, excluding food or beverages provided to the employees in the office or factory;

(f) maintenance of guest house;

(g) conference;

(h) employee welfare;

(i) use of health club, sports and similar facilities;

(j) sales promotion, including publicity;

(k) conveyance, tour and travel, including foreign travel expenses;

(l) hotel boarding and lodging;

(m) repair, running and maintenance of motor cars;

(n) repair, running and maintenance of aircraft;

(o) consumption of fuel other than industrial fuel;

(p) use of telephone;

(q) scholarship to the children of the employees.

Income Tax Calculator

Please visit this link for income tax calculation
http://law.incometaxindia.gov.in/TaxmannDit/xtras/taxcalc.aspx

Data Types In SQL Server 2005

Type From To
bigint -9,223,372,036,854,775,808 9,223,372,036,854,775,807
int -2,147,483,648 2,147,483,647
smallint -32,768 32,767
tinyint 0 255
bit 0 1
decimal -10^38 +1 10^38 –1
numeric -10^38 +1 10^38 –1
money -922,337,203,685,477.5808 +922,337,203,685,477.5807
smallmoney -214,748.3648 +214,748.3647

Approximate numerics (Numbers With Decimal Point)
Type From To
float -1.79E + 308 1.79E + 308
real -3.40E + 38 3.40E + 38

datetime and smalldatetime ( SQL Date And Time)
Type From To
datetime Jan 1, 1753 Dec 31, 9999
smalldatetime Jan 1, 1900 Jun 6, 2079

Character Strings
Type Description
char Fixed-length non-Unicode character data with a maximum
length of 8,000 characters.
varchar Variable-length non-Unicode data with a maximum of 8,000
characters.
varchar(max) Variable-length non-Unicode data with a maximum length
of 231 characters (In SQL Server 2005 only).
text Variable-length non-Unicode data with a maximum length
of 2,147,483,647 characters.

Unicode Character Strings (In computing, Unicode is an industry standard allowing computers to consistently represent and manipulate text expressed in most of the world\\\’s writing systems.)

Type Description
nchar Fixed-length Unicode data with a maximum length of 4,000
characters.
nvarchar Variable-length Unicode data with a maximum length of
4,000 characters.
nvarchar(max) Variable-length Unicode data with a maximum length of 230
characters (SQL Server 2005 only).
ntext Variable-length Unicode data with a maximum length of
1,073,741,823 characters.
Binary Strings(Binary Bits i.e 0,1)

Type Description
binary Fixed-length binary data with a maximum length of 8,000
bytes.
varbinary Variable-length binary data with a maximum length of
8,000 bytes.
varbinary(max) Variable-length binary data with a maximum length of 231
bytes (SQL Server 2005 only).
image Variable-length binary data with a maximum length of
2,147,483,647 bytes.

Other Data Types
1) sql_variant: Stores values of various SQL Server-supported data
types, except text, ntext, and timestamp.
2) timestamp: Stores a database-wide unique number that gets updated
every time a row gets updated.
3) uniqueidentifier: Stores a globally unique identifier (GUID).
4) xml: Stores XML data.
5) cursor: A reference to a cursor.
6) table: Stores a result set for later processing.

What is SQL Injection? How to prevent it?

SQL Injection is a technique used to exploit web sites by altering backend SQL statements by manipulating application input. It can happen when any application developer accepts the input of text box in SQL statement as it is.


Here is the example how on can achieve SQL injection.



Suppose a web site has a user authentication form without handling any input. Supplying the input to SQL Query as it is.


A mischievous user knows the user id but don’t know password gives user name and password as below.

User Id = mahmad

Password = abc' OR 'x'='x



So the query by this input will be like given below:

Select *

From UserTable

Where UserId='mahmad'

And Password= 'abs' OR 'x'='x';


This wrong password will work 100% without knowing password and your system is cracked.



How to prevent SQL Injection in this situation?





Solution is simple just replace single quote (') with two single quotes ('').

Escape Sequence (’) In Sql Server 2005,QUOTENAME

Suppose in sql server there is one variable
@String Varchar(max)
Now in this variable you want to store a string like this

Select * From Student_Table Where std_Name Like 'Mah%'
Suppose you are making statement as given below
Set @String='Select * From Student_Table Where std_Name Like 'Mah%''
But this will give you error.

To solve this problem you can use QUOTENAME function of SQL like given below.

Set @String='Select * From Student_Table Where std_Name Like ' + QUOTENAME('Mah%',Char(39))

Where Char(39) is ( ' ) character.

SQL Server 2005 Shortcut Keys

Below I am giving generally used shortcut keys in SQL Server 2005 :

Cancel a query. ALT+BREAK
Connections: Connect. CTRL+O
Connections: Disconnect. CTRL+F4
Connections: Disconnect and close child window. CTRL+F4
Database object information. ALT+F1 (i.e Structure Of Table etc. )
Equivalent to sp_help)
Editing: Clear the active Editor pane. CTRL+SHIFT+DEL
Editing: Comment out code. CTRL+SHIFT+C
Editing: Decrease indent. SHIFT+TAB
Editing: Increase indent. TAB
Editing: Delete through the end of a line in the Editor CTRL+DEL
Editing: Find. CTRL+F
Editing: Go to a line number. CTRL+G
Editing: Make selection lowercase. CTRL+SHIFT+L
Editing: Make selection uppercase. CTRL+SHIFT+U
Editing: Remove comments. CTRL+SHIFT+R
Editing: Replace. CTRL+H
Execute a query. CTRL+E , F5
Help for the selected TSQL statement. SHIFT+F1
Navigation: Switch between query and result panes. F6
Navigation: Switch panes. Shift+F6
New Query window. CTRL+N
Object Browser (To show/hide). F8
Object Search. F4
Parse the query for checking syntax. CTRL+F5
Print. CTRL+P
Results: Display results in grid format. CTRL+D
Results: Display results in text format. CTRL+T
Results: Save results to file. CTRL+SHIFT+F
Results: Show Results pane (toggle). CTRL+R
Save. CTRL+S
Tuning: Index Tuning Wizard. CTRL+I
Change / Select Database. CTRL+U

Accept Only Numbers In Text Box

//This javascript can be used to accept only numbers in any text box in asp.net





//After Adding this script to souce code please add the following statement on pageLoad event to register the java script to text box named txtRs



txtRs.Attributes.Add(”onkeydown”, “JavaScript:return isNumericKeyPressed();”);

What is ERP ?

ERP stands for Enterprise Resource Planning. ERP is a software system which is used to

integrate the data and processes of an organization into one single software system. Usually

ERP systems will have many components including hardware and software, in order to achieve

integration of different departments of big company or organization.
Advantages of ERP Systems

1. Totally integrated system
2. Good bility to share data across various departments in an organization
3. Improved efficiency and productivity levels
4. Better tracking and forecasting with MIS reports.
5. Costs reduction.
6. Better customer satisfaction.
ERP System generally consists modules :
1. Sales.
2. Purchase.
3. Production.
4. Payroll.
5. HR.
6. Inventory.
7. Finance.

What is CTC ?

CTC abbreviates for Cost To Company. Suppose your Gross Salary of a month is
Rs.25000/-. Your annual salary will be 300000(Rs. 3 Lack). So Rs. 300000/ will be your
CTC.

What Is Difference Between CV And Resume ?

Resume is the summary of your Education Qualification,Experience Related information . CV (Curriculum Vitae) is the document with all the details of your Educational Qualification starting from your high school days to graduation,post graduation and Phd. Experience details from starting your career to till date’s information. Also you have to provide information about your current employer and all previous employer with some reference details.
Generally when we are uploading in any career related sites like naukri.com we are uploading resume as it is small enough to quickly go through it.

Search Engines

Most Popular Search Engines
1. Google
2. Whatuseek
3. Wisenut
4. ExactSeek
5. Scrubtheweb
6. Jayde
Other Search Engines
7. AOL Search
8. HotBot
9. Search.com
10.Metacrawler
11.Dogpile
12.Mamma
13.C4
14.Canada.com
15.ixquick
16.Infogrid
17.AllTheWeb.com
18.Query Server
19.800go
20.Debriefing
21.Highway 61
22.com
23.OneSeek
24.MetaSpider
25.Vivisimo
26.PlanetSearch surfwax
27.qbSearch
28.ProFusion
29.Proteus
30.Go 2 Net
31.MegaGo.com
32.WebFile
33.myGO
34.Megacrawler
35.Search Climbers

About Leave

CL Casual Leave
This leave can be taken when there is some emergency or personal

work to be completed.

SL Sick Leave
Obviously when you are sick you are eligible for this type of

leave.
PL Priviledge Leave
This leave is meant for long time leave i.e to go for vacation

etc. When you want PL you have to apply in advance while in CL or SL no

need to prior application.

It depends on the company policy how much leave it provides

generally total 21 leaves are provided in companies i.e 7 SL,7 CL and 7

PL. Many MNCs providing 21 PL and 12 (CL+PL).

MVP Model

This is a model used in software development process. Here logic of different parts of development is devided in three different parts.

1. Model – This is be your business object which has your business logic in it like calling of stored procedures,validations etc.

2. View – This is your User Interface which has controls like TextBox,Label etc.

3. Presenter – This is an object whose only work is to join View and Model.

CSV

CSV stands for Comma Seperated Values. This is a file using for storing data in text format with seperation of comma(,) between two fields. If there is any comma in the field it will be represented by a pair of double-quote characters.
Like:
RollNo-Name-Course-Address
125,Khoja Mahmadhusen,BCA,”Junagam,Pipal Faliya”

Fields with embedded double-quote characters will be delimited by double-quote characters, and the embedded double-quote characters will be represented by a pair of double-quote characters.
Like:
125,Khoja Mahmadhusen,BCA,”Junagam “”123″”,Pipal Faliya”

The first record in a csv file can contain column names in each of the fields.
Like:
RollNo,Name,Course,Address
125,Khoja Mahmadhusen,BCA,”Junagam,Pipal Faliya”

How to create In / Out Parameter for SQL Stored Procedure in asp.net ?

SqlParameter sqlParam = new SqlParameter(paramName, paramType);
sqlParam.Direction = paramDirection;
//which can be ParameterDirection.Input or ParameterDirection.Output

How to run sql query in asp.net ?

private SqlConnection sqlConn=new SqlConnection("ConnectionString");
sqlConn.Open();
SqlCommand sqlCmd = new SqlCommand("Query", sqlConn);
SqlCommand.ExecuteNonQuery()

sqlCmd.Dispose();
sqlConn.Close();

How to copy a row within same table ?

If you want to copy a row in a datatable to the same table you can use ImportRow.
Example :
Suppose a DataTable dtUser has some rows and you want to add another row from the same table.
dtUser.ImportRow(dtUser.Rows[0]);

How To Send DataSet As An XML to SQL Server 2005 Stored Procedure ? Pass DataSet To Stored Procedure

There is some time when we want to send the result of a dataset to send to a stored

procedure without using loop as it is time and resource consuming. Here I am giving an

example how we can send DataSet as XML To Stored Procedure As A Parameter.

Suppose DataSet dsStudent has One table at position 0. Having three columns
GrNo
Name
City

And suppose it has 10 records in front end and you want to send as it is to stored

procedure to make any operation , say to insert into an actual table.

First of all you have to make an input parameter for your stored procedure and send

the dataset as an xml.

dtStudent.GetXml();

This method will send you dataset as a whole to the stored procedure as a parameter.

It will send the parameter’s table as ‘/NewDataSet/Table’. If you have specified a

name to table for dataset instead of Table it will be the name specifi ed by you.

–Declare A Variable To Prepare XML Document
Declare @idoc int

exec sp_xml_preparedocument @idoc OUTPUT,@Param1 –This Statement Will Prepare your

xml document where @Param1 is the parameter passed by you of type XML.

Now let’s insert the data from dataset to the table in SQL Server 2005

Insert Into dbo.Mst_Student
(GrNo,Name,City)

Select GrNo,Name,City
From OpenXML (@idoc,’/NewDataSet/Table’,2)
With (GrNo int,Name Varchar(50),City Varchar(50))

exec sp_xml_removedocument @idoc

This statement will insert all the records from ‘/NewDataSet/Table’ To your actual

table in SQL Server 2005 “Mst_Student”

Please do remember to remove the xml document from memory.

dot net framework 1.1 vs 2.0 , What’s New in the .NET Framework Version 2.0

Please visit below link :
http://msdn.microsoft.com/en-us/t357fb32.aspx

Assembly In Dot Net,What is an assembly in Asp.Net?

An assembly in ASP.NET is a collection of single-file or multiple files. The assembly that has more than one file contains

either a dynamic link library (DLL) or an EXE file. The assembly also contains metadata that is known as assembly manifest.

The assembly manifest contains data about the versioning requirements of the assembly, author name of the assembly, the

security requirements that the assembly requires to run, and the various files that form part of the assembly.



The biggest advantage of using ASP.NET Assemblies is that developers can create applications without interfering with other

applications on the system. When the developer creates an application that requires an assembly that assembly will not affect

other applications. The assembly used for one application is not applied to another application. However one assembly can be

shared with other applications. In this case the assembly has to be placed in the bin directory of the application that uses

it.
Type Of Assembly :

Private Assembly

Shared Assembly



There are many advantages of assembly some of them are as follows:

(1) Increased performance.

(2)Better code management and encapsulation.

(3)Introduces the n-tier concepts and business logic.

What is Common Language Runtime ?

Programming languages on the .NET Framework compile into an intermediate language known as

the Common Intermediate Language (CIL). In Microsoft’s implementation this intermediate

language is not interpreted but rather compiled in a manner known as just-in-time

compilation (JIT) into native code. The combination of these concepts is called the Common

Language Infrastructure (CLI). Microsoft’s implementation of the CLI is known as the Common

Language Runtime (CLR).

Dot Net Framework Version

Version
Version Number
Release Date

1.0
1.0.3705.0
2002-01-05

1.1
1.1.4322.573
2003-04-01

2.0
2.0.50727.42
2005-11-07

3.0
3.0.4506.30
2006-11-06

3.5
3.5.21022.8
2007-11-09

Manifest And Metadeta In Dot Net,Manifest,Metadata

In dot net 2.0 collection of file are called assembly.and in these assembly one file(EXE or .DLL)contains a special metadata called manifest.and these manifest is stored as binary data and contains the detail like versioning requirements for the assembly,the author,security
permissions,and list of files forming the assembly.while the metadata is called data about data.

What is Dot Net Framework ?

.NET Framework in an environment which provides coding,debugging and running programmes written in any .net languages like vb.net,c#.net,j#.net.
The .NET Framework contains three major parts:
* the Common Language Runtime
* the Framework Class Library
* ASP.NET.

How to select an item in DropDownList In Asp.net ?

ddl_Vehicle.ClearSelection();
ddl_Vehicle.Items.FindByText("Bus").Selected = true;

Authentication In Asp.net

Authentication is the process of obtaining identification credentials from a user ( like user name and password ), and validating those credentials against some authority.

There are 4 type of authentication modes which you can set in web.config file.
1.) None
2.) Windows
3.) Forms
4.) Passport

like

ASP.NET State Management

Every time when the web page is posted back to server a new instance of that web page is created. To persist data between different post back events asp.net provides state management.

You can use following features for data persistency.

View state
Control state
Hidden fields
Cookies
Query strings
Application state
Session state
Profile Properties

Where View state, control state, hidden fields, cookies, and query strings stores data at the client side in various formats.While application state, session state, and profile properties store data at the client side.

Please visit http://www.csharphelp.com/archives/archive207.html for more information and example of state management.

Visual Studio 2005 Shortcut Keys

Ctrl-Shift-S Saves all documents and projects
F7 Switches from the design view to the code view in the editor
Shift-F7 Switches from the code view to the design view in the editor
F8 Moves the cursor to the next item, for example in the
TaskList window or Find Results window
Shift-F8 Moves the cursor to the previous item, for example in the
TaskList window or Find Results window
Shift-F12 Finds a reference to the selected item or the item under the
cursor
Ctrl-Shift-G Opens the file whose name is under the cursor or is currently
selected
Ctrl-/ Switches focus to the Find/Command box on the Standard toolbar
Ctrl-Shift-F12 Moves to the next task in the TaskList window
Ctrl-Shift-8 Moves backward in the browse history. Available in the object
browser or Class View window
Shift-Alt-A Displays the Add Existing Item dialog
Ctrl-Shift-A Displays the Add New Item dialog
Ctrl-+ Goes back to the previous location in the navigation history.
Ctrl-Shift-+ Moves forward in the navigation history. This is effectively an undo for the View.NavigateBackward operation
Ctrl-F4 Closes the current MDI child window
Shift-Esc Closes the current tool window
Ctrl-F2 Moves the cursor to the navigation bar at the top of a code
view
Ctrl-Tab Cycles through the MDI child windows one window at a time
Ctrl-F6,Ctrl-Shift-TabMoves to the previous MDI child window
Alt-F6,Ctrl-Shift-F6 Moves to the next tool window
Shift-Alt-F6 Moves to the previously selected window
F6 Moves to the next pane of a split pane view of a single
document
Shift-F6 Moves to the previous pane of a document in split pane view
Ctrl-Shift-F9 Clears all of the breakpoints in the project
Ctrl-Alt-E Displays the Exceptions dialog
F5 If not currently debugging, this runs the startup project or
projects and attaches the debugger. If in break mode, this
allows execution to continue (i.e., it returns to run
mode).
Ctrl-F5 Runs the code without invoking the debugger. For console
applications, this also arranges for the console window to
stay open with a “Press any key to continue” prompt when
the program finishes
F11 Executes code one statement at a time, tracing execution into
function calls
Shift-F11 Executes the remaining lines of a function in which the current
execution point lies
F10 Executes the next line of code but does not step into any
function calls
Shift-F5 Available in break and run modes, this terminates the debugging
session
F9 Sets or removes a breakpoint at the current line
F12 Displays the definition for the selected symbol in code
Ctrl-Alt-A Displays the Command window, which allows you to type commands
that manipulate the IDE
F4 Displays the Properties window, which lists the design-time
properties and events for the currently selected item
Ctrl-Alt-L Displays the Solution Explorer, which lists the projects and
files in the current solution
Ctrl-Alt-K Displays the TaskList window, which displays tasks, comments,
shortcuts, warnings, and error messages
Ctrl-Alt-X Displays the Toolbox, which contains controls and other items
that can be dragged into editor and designer windows

Accounting Effects

Sales
Customer A/C (i.e Debtors) Dr Debited
Sales A/C Cr Credited

Receipt Of Sales
Customer A/C (i.e Debtors) Cr Credited
Cash/Bank A/C Dr Debited

Purchase
Supplier A/C (i.e Creditors) Cr Credited
Purchase A/C Dr Debited

Payment Of Purchase
Supplier A/C (i.e Creditors) Dr Debited
Cash/Bank A/C Cr Credited

TDS Tax Deduction At Source

TDS is deducted by Employer or Buyer of any particulars. The tax is paid to government (i.e in authorized bank) by them on behalf of seeller or employee. As a proof of the deduction employer is giving a copy of Form 16 to employee and buyer is giving a copy of Form 16A to seller so that he can submit it to government body.

Tax Collection At Source (TCS)

TCS is deducted by seller from buyer. For example one buyer buys an item costing Rs.1000/- and seller giving bill of Rs.1100/- as Rs.1000/- item price + Rs.100/- i.e 10% tax on that item.