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();
}
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Ranjit PowarPosted Nov 12, 2015, 10:41 AM
Ravi PatelPosted Nov 12, 2015, 11:57 AM
Hawi AdenPosted Nov 12, 2015, 10:02 AM
code of Get Data From DtaBase
{
SqlDataAdapter da = new SqlDataAdapter(SQL, cn);
DataSet ds = new DataSet();
da.Fill(ds, TBL);
return ds;
}
-----------------------------------------------------------------------------------------------------------
Ranjit PowarPosted Nov 12, 2015, 9:27 AM
Ranjit PowarPosted Nov 12, 2015, 9:27 AM