Jayanth Reddy

Jayanth Reddy

  • NA
  • 250
  • 9.8k

display decimal upto two points after retrieving frm db

Aug 1 2019 12:38 AM
I have created a Linq to SQL class and in my Employee table i have a column named as salary with decimal data type.Now when I am trying to  
 retreive to the application salary is upto four decimal points.Can any one help me how to fix it to two decimal points.
 
public partial class Form1 : Form
{
CompanyDataContext dc= new CompanyDataContext();
public Form1()
{
InitializeComponent();
}
void LoadData(){
CompanyDataContext dc = new CompanyDataContext();
Table<Employee> tb = dc.Employees;
dg1.DataSource = tb;
}
private void Form1_Load(object sender, EventArgs e)
{
LoadData();
}

Answers (1)