Ido Posted November 9, 2003 Posted November 9, 2003 Hi, i want to show the user an empty table on the web. This table, with differents data, already exists in the database. When the user will press "Add" a new row will be added to the table, which then he can fill in data. When the user finish, he will press "Submit" to add the new rows to the table in the database. I'm not sure how should i do that. Do i need to build a custom dataset? I suppose i need to declare on a new dataset, and datatable. with the required columns (what if i have many?), add lines whenever the user press "Add", and add them to the existing table in the database, how? with Update? i think not. how can i add(not update) new rows to a table in the database? (I'm writing vb.net in vs.net.) Quote
Moderators Robby Posted November 9, 2003 Moderators Posted November 9, 2003 You can use an INSERT INTO statement in the SqlCommand object using the ExecuteNonQuery method. Quote Visit...Bassic Software
Ido Posted November 10, 2003 Author Posted November 10, 2003 OK, thanks! I have more.... How can i get from the user the new data, and added them to the database tabel afterwords? how it is done? Should i fill a dataset with the database table, add a new row with defaults values, dispaly the user only the new row (he doesn't want to see all other rows). ...or can i create a dataset on the fly, add new rows as many as the user ask, and only after he presses"submit" then I will "go to" the database and add the new rows to the correct table? Quote
Moderators Robby Posted November 10, 2003 Moderators Posted November 10, 2003 If the user is entering data into Textboxes then you don't need any Datatable nor Dataset. All you need is what I mentioned earlier. Quote Visit...Bassic Software
Ido Posted November 10, 2003 Author Posted November 10, 2003 Well, i want to use a datagrid. The datagrid will have some dropdown list (more than 1) , and a few more of text boxes. To be able to show a new line, on a respond to the user pressing the "Add" button, i need a dataset to be binded later to the datagrid, no? Thanks. Quote
Moderators Robby Posted November 10, 2003 Moderators Posted November 10, 2003 Sorry, when I read "He doesn't want to see all the rows" I figured you would skip the datagrid. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.