INvoice No generation using typed dataset
<p>iam using typed data set and my code is here 
 Actually i am making Invoice slip so senario is this first fill invoice header table where invoiceNo is generate after that it will use in Sub table </p>

<p>2 problems </p>

<ol>
<li>i wanna check wherther ther value in datatable (invoiceNO) exist or not </li>
<li>fill the last value of invoice headertable when creating new invoice ! </li>
</ol>

<p>-</p>

<pre><code>  using (AmdDataSet.InvoiceHeaderTableDataTable htabel = new AmdDataSet.InvoiceHeaderTableDataTable())
        {
            using (AmdDataSetTableAdapters.InvoiceHeaderTableTableAdapter hadp = new AmdDataSetTableAdapters.InvoiceHeaderTableTableAdapter())
            {


                hadp.Fill(htabel);
                hadp.GetData();
                AmdDataSet.InvoiceHeaderTableRow hRow;
                if (hRow.IsNull("InvoiceNo"))
                {
                    hRow = htabel.NewInvoiceHeaderTableRow();
                    hRow.InvoiceDate = Convert.ToDateTime(DateTime.Now);

                    htabel.AddInvoiceHeaderTableRow(hRow);

                    using (AmdDataSetTableAdapters.InvoiceHeaderTableTableAdapter hadpter  = new AmdDataSetTableAdapters.InvoiceHeaderTableTableAdapter())
                    {
                        hadpter.Update(hRow);

                    }
                    string irow = hRow.InvoiceNo.ToString();
                    return irow;

                }
                else
                {
                    string irow = hRow.InvoiceNo.ToString();
                    return irow;

                }

            }
</code></pre>

<p>}</p>
