Hawi Aden

Hawi Aden

  • NA
  • 17
  • 2.9k

how to use the MAX(Date) in C#

Nov 12 2015 9:18 AM

Hi All

I want to search about max date from a table but my code don't work,

can any one help me please .
------------------------------------------------------------------------------------- 
C#-code in class:

public DataSet ShowFees(int no_mum)

{

string sql = "select MAX(f_date) from fees where no_mum=" + no_mum;

return (Getdata(sql, "fees"));

}

----------------------------------------------------------- 
C#-code in presintion:

private void button1_Click(object sender, EventArgs e)

{

DataSet ds2 = wor.ShowFees(Convert.ToInt32(textBox2.Text));

label5.Text = ds2.Tables["fees"].Rows[0]["f_date"].ToString();

           

}

 
 

Answers (5)