try
{
string query = "";
// query += "SELECT WOInwardEntry.InvoiceNo FROM WOInwardEntry INNER JOIN WO ON WOInwardEntry.WOCode = WO.WOCode where WOInwardEntry.WOCode = '" + ddWONumber.SelectedItem.Value + "'";
query += "select InvoiceNo,InvoiceDate,InwardDate from WOInwardEntry where wocode ='" + ddWONumber.SelectedItem.Value + "'";
cmd = new SqlCommand(query, cn);
da = new SqlDataAdapter(cmd);
da.Fill(ds);
if ((ds != null) && (ds.Tables.Count != 0) && (ds.Tables[0].Rows.Count != 0))
{
txtInvoiceNo.Text = ds.Tables[0].Rows[0]["InvoiceNo"].ToString();
txtInvoiceDate.Text = Convert.ToDateTime( ds.Tables[0].Rows[0]["InvoiceDate"]).ToString("dd-mm-yyyy");
txtInwardDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["InwardDate"]).ToString("dd-mm-yyyy");
}
//FillItems();
}
catch { }
finally { }
is it right to retrive more than one raw?

Iftikar HussainRank #423 · 5.9K reputationPosted Jul 14, 2013, 9:38 PM EDT
Are you trying to bind your output to any grid?
Regards,
Iftikar
Riyaz AkhtarRank #2,275 · 619 reputationPosted Jul 14, 2013, 10:46 PM EDT
if u have more than one rows then i suggest to use textbox inside repeater or gridview.
Syed Rizwan35 reputationPosted Jul 15, 2013, 12:04 AM EDT
Abhineet SrivastavaRank #1,890 · 783 reputationPosted Jul 18, 2013, 5:58 AM EDT