Can we send a datagrid's records directly to the database?
-
hello all, this could be a stupid question. but for me it is a headache. i've been trying to do it for some time with no luck. i have got a datagrid with some data. i want to write the code to send the rows of data directly into a table on the click event of a button. how is this possible. if anyone knows how please do help me. thanks :rose:
-
hello all, this could be a stupid question. but for me it is a headache. i've been trying to do it for some time with no luck. i have got a datagrid with some data. i want to write the code to send the rows of data directly into a table on the click event of a button. how is this possible. if anyone knows how please do help me. thanks :rose:
First count the no of row in dataset dim rowno as integer = dataset.row.count for rowno = 0 to rowno 'creating a loop dim strval as string=datagrid.items(row#,coloum1).tostring dim insert as string = "insert into table(field)values(strval)'write the insert command here cmd1 = new oldbcommdbuilder(insert) cmd1.nonexecutereader next hope it helps you If you still have any questions let me know i will give you detailed explanation. take care Regards :-D
-
First count the no of row in dataset dim rowno as integer = dataset.row.count for rowno = 0 to rowno 'creating a loop dim strval as string=datagrid.items(row#,coloum1).tostring dim insert as string = "insert into table(field)values(strval)'write the insert command here cmd1 = new oldbcommdbuilder(insert) cmd1.nonexecutereader next hope it helps you If you still have any questions let me know i will give you detailed explanation. take care Regards :-D
hi, thanks for ur help. right now i am in another project team doing a project in asp.net. i will try out ur solution and let u know. thanks, lavanya