Hi I have some variables assigned with values. i need to read the variables values one by one which is in a loop and assigned them to the datatable which i have created using VB.Net.. Please help me on this..
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need to create a DataRow and add these to the DataTable. If the values are in a List you can iterate through and add one at a time. If the values are in separate values you’re probably best to add each in turn.
See here for more details:
MSDN How to: Add Rows to a DataTable
From this example you could use the following
The configuration of the DataAdapter is specific to your enviroment, but you will need a connection to the database and an InsertCommand to persist the data in the database.