HOW TO FIX THIS EVERYTIME I ADD DATA IN MY DATA TABLE THE LASTROW AND FIRSTROW ARE THES SAME [modified]
-
HOW TO ELIMINATE ONE
DataTable dt = dataSet1.Tables["tmpItem_aux"]; DataRow newRow = dt.NewRow(); newRow["itemcode"] = itemcodeTextBox.Text.ToString(); newRow["itemDesc"] = itemDescTextBox.Text.ToString(); newRow["quantity"] = quantityTextBox.Text.ToString(); newRow["unitPrice"] = unitPriceTextBox.Text.ToString(); newRow["total"] =totalTextBox.Text.ToString(); dt.Rows.Add(newRow);
OUTPUT SAMPLE ITEMCODE ITEMDESC QUANTITY UNITPRICE TOTAL TEST123 ITEMTEST 1 50 50 --------SAME IN LASTROW SAMPLE1 ITEMSAMPLE 2 100 200 SAMCODE SAMDESC 3 20 60 TEST123 ITEMTEST 1 50 50 --------SAME IN FIRST ROWmodified on Friday, May 14, 2010 2:34 AM
-
HOW TO ELIMINATE ONE
DataTable dt = dataSet1.Tables["tmpItem_aux"]; DataRow newRow = dt.NewRow(); newRow["itemcode"] = itemcodeTextBox.Text.ToString(); newRow["itemDesc"] = itemDescTextBox.Text.ToString(); newRow["quantity"] = quantityTextBox.Text.ToString(); newRow["unitPrice"] = unitPriceTextBox.Text.ToString(); newRow["total"] =totalTextBox.Text.ToString(); dt.Rows.Add(newRow);
OUTPUT SAMPLE ITEMCODE ITEMDESC QUANTITY UNITPRICE TOTAL TEST123 ITEMTEST 1 50 50 --------SAME IN LASTROW SAMPLE1 ITEMSAMPLE 2 100 200 SAMCODE SAMDESC 3 20 60 TEST123 ITEMTEST 1 50 50 --------SAME IN FIRST ROWmodified on Friday, May 14, 2010 2:34 AM
DON'T SHOUT! Some of us may have hangovers.
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in. Apathy Error: Don't bother striking any key.
-
DON'T SHOUT! Some of us may have hangovers.
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in. Apathy Error: Don't bother striking any key.
OriginalGriff wrote:
Some of us mayWe have hangovers.
FTFY
Dave
If this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) -
OriginalGriff wrote:
Some of us mayWe have hangovers.
FTFY
Dave
If this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Not me - don't drink these days! :laugh:
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in. Apathy Error: Don't bother striking any key.
-
Not me - don't drink these days! :laugh:
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in. Apathy Error: Don't bother striking any key.
OriginalGriff wrote:
days
Only nights ;P
I know the language. I've read a book. - _Madmatt
-
HOW TO ELIMINATE ONE
DataTable dt = dataSet1.Tables["tmpItem_aux"]; DataRow newRow = dt.NewRow(); newRow["itemcode"] = itemcodeTextBox.Text.ToString(); newRow["itemDesc"] = itemDescTextBox.Text.ToString(); newRow["quantity"] = quantityTextBox.Text.ToString(); newRow["unitPrice"] = unitPriceTextBox.Text.ToString(); newRow["total"] =totalTextBox.Text.ToString(); dt.Rows.Add(newRow);
OUTPUT SAMPLE ITEMCODE ITEMDESC QUANTITY UNITPRICE TOTAL TEST123 ITEMTEST 1 50 50 --------SAME IN LASTROW SAMPLE1 ITEMSAMPLE 2 100 200 SAMCODE SAMDESC 3 20 60 TEST123 ITEMTEST 1 50 50 --------SAME IN FIRST ROWmodified on Friday, May 14, 2010 2:34 AM
We can't possibly help you because we don't know what the code looks like that called the code you've already posted. And turn off your CapsLock key.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
HOW TO ELIMINATE ONE
DataTable dt = dataSet1.Tables["tmpItem_aux"]; DataRow newRow = dt.NewRow(); newRow["itemcode"] = itemcodeTextBox.Text.ToString(); newRow["itemDesc"] = itemDescTextBox.Text.ToString(); newRow["quantity"] = quantityTextBox.Text.ToString(); newRow["unitPrice"] = unitPriceTextBox.Text.ToString(); newRow["total"] =totalTextBox.Text.ToString(); dt.Rows.Add(newRow);
OUTPUT SAMPLE ITEMCODE ITEMDESC QUANTITY UNITPRICE TOTAL TEST123 ITEMTEST 1 50 50 --------SAME IN LASTROW SAMPLE1 ITEMSAMPLE 2 100 200 SAMCODE SAMDESC 3 20 60 TEST123 ITEMTEST 1 50 50 --------SAME IN FIRST ROWmodified on Friday, May 14, 2010 2:34 AM
Just don't add the second row. check the data being added for unique values against the existing table. If the data exists, don't add it.
- Kalvin