473,385 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

initialize an ADO object from an array of string

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

Jun 22 '06 #1
2 1455
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<ll***@yahoo.com> wrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
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

Jun 22 '06 #2
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

Jun 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: steveneng | last post by:
C++ Primer Plus Programming Exercises 4th Ed - Prate Help I'm trying to refresh myself and I'm stuck on this problem (not homework/school related but for personal advancement). 6: Do...
74
by: Peter | last post by:
Hi, So many times, I have seen compile warning: "you used a char* without initilize it", probably on the code like this: ------------ char* ptr; func(..., ptr); ----------
4
by: Mark Hannon | last post by:
I am trying to initialize an array only once so it can be seen & used by any functions that need it. As I understand it, if a variable is declared by itself outside of any functions, its scope is...
2
by: slack_justyb | last post by:
Hello, I'm trying to figure the best way of doing the following. *I need an array of strings that are globally accessable from within 'arrayhere.h' *I need that array of strings to not change...
15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
2
by: deko | last post by:
I trying to create a jagged array of two arrays, with the second array being an array of two-dimensional arrays. A graphical representation might look like this: x y y y x y x y y x ...
2
by: lluum | last post by:
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...
18
by: toton | last post by:
Hi, In C++ when I initialize an array it, also initializes the class that it contains, which calls the default constructor. However, I want to initialize the array only (i.e reserve the space) and...
15
by: thinktwice | last post by:
char a = { 0 } is it ok?
38
by: Zytan | last post by:
What is the difference between these two lines? Dim args As Object() = New Object() {strText} Dim args As Object() = {strText} args seems usuable from either, say, like so: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.