Hi,
In the report page it shows all the record instead of one record? If the customer wants to search with the particular orderno.if he enteres the order no as like 1 it shows that particular record only.But,in my report page it shows all the records.how can i solve this problem.
private void btn_search_Click(object sender, EventArgs e)
{
MessageBox .Show ("");
SqlConnection con = new SqlConnection("data source=mars-104;initial catalog=marsweb;integrated security=true");
SqlCommand cmd = new SqlCommand("select compname,compaddress,invoiceno,orderno,convert(varchar,ondate,105),convert(varchar,invoicedate,105),amountstatus,netamount,netvat,tamount from tbl_report2", con);
con.Open();
cmd.Parameters.AddWithValue("@orderno", txt_orderno.Text);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
con.Close();
}
else
{
GridView1.Controls.Clear();
MessageBox.Show("sorry no data availlable");
}
}
Best,
Sudheep.