0% found this document useful (0 votes)
26 views2 pages

Pay Roll System in DOTNET

The document outlines steps to develop a payroll system in .NET: 1. Create a new website in C# in Visual Studio 2. Design an ASPX form page for the payroll system 3. Connect the form to a SQL Server database to store employee salary and personal details It then provides code snippets for the payroll system form coding using C# and connecting to the SQL Server database to insert and retrieve employee salary records.

Uploaded by

suganya004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Pay Roll System in DOTNET

The document outlines steps to develop a payroll system in .NET: 1. Create a new website in C# in Visual Studio 2. Design an ASPX form page for the payroll system 3. Connect the form to a SQL Server database to store employee salary and personal details It then provides code snippets for the payroll system form coding using C# and connecting to the SQL Server database to insert and retrieve employee salary records.

Uploaded by

suganya004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Develop the pay roll system in DOTNET.

Procedure
1. Open visual studio
2. Create new website in c# language.
3. Create the database in sqlserver
4. Design the pay roll system form in aspx page.
5. Make the database connection to store the employees salary and personal
details

Form design

Coding

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

public partial class _Default : System.Web.UI.Page


{

SqlConnection DBCon;
SqlDataAdapter DA;
String StrSql;
SqlCommand myComm;
DataSet DS = new DataSet();

protected void Page_Load(object sender, EventArgs e)


{
DBCon = new SqlConnection("Data Source=HOME-PC\\SQLEXPRESS;Initial
Catalog=Salary;Persist Security Info=True;User ID=sa;Password=123456789;");
}
protected void Button1_Click(object sender, EventArgs e)
{
String namestr, deptstr, desgstr ;
int basicint, gradeint, daint, hraint, pfint, mediint, itint, netint,
grossint, totded;

namestr = name.Text;
deptstr = dept.SelectedItem.Text;
desgstr = desg.SelectedItem.Text;

basicint =Convert.ToInt16( basic.Text);


gradeint = Convert.ToInt16(grade.Text);
daint = Convert.ToInt16(da.Text);
hraint = Convert.ToInt16(hra.Text);
mediint = Convert.ToInt16(medi.Text);
itint = Convert.ToInt16(it.Text);

daint = ((basicint + gradeint) * 27) / 100;


pfint = ((basicint + gradeint + daint) * 12) / 100;
grossint = basicint + gradeint + daint + hraint;

totded = pfint + itint + mediint;


netint = grossint - totded;

pf.Text = Convert.ToString(pfint);
gross.Text = Convert.ToString(grossint);
net.Text = Convert.ToString(netint);

DBCon.Open();

StrSql = "insert into


Salarymas(Name,Designation,Department,Basic,Gradepay,DA,HRA,PF,Mediclaim,IT,Netpay
,Grosspay) values ('" + namestr + "','" + desgstr + "','" + deptstr + "'," +
basicint + "," + gradeint + "," + daint + "," + hraint + "," + pfint + "," +
mediint + "," + itint + "," + netint + "," + grossint + ")";
myComm = new SqlCommand(StrSql, DBCon);
myComm.ExecuteNonQuery();

// DA.Fill(DS, "ROLLID") ;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
DBCon.Open();
DA = new SqlDataAdapter("Select * from Salarymas", DBCon);
DA.Fill(DS, "Salarymas");

GridView1.DataSource = DS;
GridView1.DataBind();
}
}

You might also like