4
Answers

pls check this query?

Ask a question
 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?

Answers (4)