initialize an ADO object from an array of string

  • Thread starter Thread starter lluum
  • Start date Start date
L

lluum

Hello All,

I have a newbie question on ADO. I understand that I can initialize
ADO objects from the results of a query to a database, or from a csv
file. I have an array of strings. How can I pump the array of string
into an ADO object with one or two lines of code (like initalize ADO
from a query to db).

Thank you very much for your input.

Alex
 
Alex,

I don't know about one or two lines of code, but you could create a
DataSet easily, add the DataTable, add the DataColumn to the DataTable, then
cycle through your array and then add the strings.

I hope you are not doing this for data binding. You can bind to the
array of strings just like you could the DataSet.

Hope this helps.
 
Thank you very much Nic. Two follow-up questions.

$ I don't know about one or two lines of code, but you could create a
$ DataSet easily, add the DataTable, add the DataColumn to the
DataTable, then
$ cycle through your array and then add the strings.

So, here we are using a foreach loop to do the job? Am I right?

$ I hope you are not doing this for data binding. You can bind to the
$ array of strings just like you could the DataSet.

If fact, I may also need data binding later on. Could you show me an
example of binding to an array of strings?

Thank you so much.

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top