Have a trouble with DataSet

nosebleed

New member
Joined
Feb 2, 2006
Messages
1
Form has dropdownlistbox.
I want add selected item from DDL to DataTable in dataset and assume it with DataGrid.

The first row adds normally, but when i add the second row grid consist only one row that i add last time.
For example:
1. choice is "ddd" --> in a grid one row "ddd"
2. choice is "lll" --> in a grid must be || "ddd" || "lll" ||
but there is only "lll" row in a grid.
code:

procedure TWebForm3.Button1_Click(sender: System.Object; e: System.EventArgs);
var nr:dataRow;
begin
nr:=datasetNew.Tables[new].NewRow;
nr[name]:=DropDL.SelectedItem.Text;
dsNew.Tables[new].Rows.Add(nr);
D_Grid.DataBind;
end;
 
Back
Top