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.

Store database values in array

10
Dear Techies,

I have a code which retrieves values from database
Expand|Select|Wrap|Line Numbers
  1. cmdSelect = New OleDbCommand("select fields,finesFields from trafficReport where checked LIKE 1", conn)
  2.         cmdSelectDr = cmdSelect.ExecuteReader
  3.  
  4.         While cmdSelectDr.Read
  5.             MsgBox("Select " + cmdSelectDr(0) + cmdSelectDr(1) + " from fines")
  6.             'strtest = cmdSelectDr(0)
  7.  
  8.             'Store all values in array here
  9.         End While

i want to store all the values in a array for further processing.

Any help would be highly appreciated

thanks
Nadir
Apr 4 '09 #1
3 6401
iam_clint
1,208 Expert 1GB
You could do something like this ->
Expand|Select|Wrap|Line Numbers
  1. dim ds as new dataset
  2. dim dbadap as new sqldataadapter
  3. cmdSelect = New OleDbCommand("select fields,finesFields from trafficReport where checked LIKE 1", conn)
  4. dbadap.fill(ds, "trafficReport")
  5.  
So your table is stored locally in a dataset and be used again else where... I don't see any reason to really store this data into an array?
Apr 14 '09 #2
nady
10
Hi,
thanks for the reply.
the reason why i need to store in array is i need for further processing.


Many thanks
Nadir Firfire
Apr 15 '09 #3
iam_clint
1,208 Expert 1GB
Well when you set it in a dataset all the values are still there just stored on the server rather than the sql db..

so after you fill the ds like i showed above later on you can do

Expand|Select|Wrap|Line Numbers
  1. for each rs as datarow in ds.tables(0).rows
  2.    msgbox(rs("traffic_id"))
  3. next
  4.  
or something similiar along those lines. you can also update the dataset simply by

Expand|Select|Wrap|Line Numbers
  1. for each rs as datarow in ds.tables(0).rows
  2.  if conditions then
  3.    rs("traffic_id")=1
  4. end if
  5. next
  6.  
Apr 15 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Christopher Brandsdal | last post by:
Hi! I have a delicatg problem.... I have made a registration form for adding my friends information in a database. The problem is that I want to connect the persons with companies in the same...
11
by: Colin Steadman | last post by:
Hope this makes sense! I'm building an ASP page which allows uses to add items to an invoice via a form, ie: Item No Part No Order No Quanity Units Price VAT ------- ...
11
by: hoopsho | last post by:
Hi Everyone, I am trying to write a program that does a few things very fast and with efficient use of memory... a) I need to parse a space-delimited file that is really large, upwards fo a...
3
by: Tillman Erb | last post by:
Let's assume a database with a parent table and a child table in a one-to-many relationship, respectively. I have a DataList control on page P that displays values from the parent table. Each row...
10
by: Peter Stojkovic | last post by:
I want store an integer-array of 1000 Values in a blob in a SQL-database. I will do this every 10 Seconds. How can I do this ???? What datatypes a have to use ??? Thanks
3
by: Solution Seeker | last post by:
I want to Store the String value with Single Quotes in the Field of Database where if i try to Store the String value with Single Quotes (as it is) then it is throwing the error as SQL String...
20
by: sruthini | last post by:
Hi, I am doing send some values(signup form::firstname,lastname,title,organization) to mail id using javamail at the same time it should store in database, my problem is how to fetch values from...
9
by: Ajinkya | last post by:
Hello friends ! , I am very new to java script.If anyone can help me then I will be very very thankful to his/her. I am using php and mysql in my project and I have one textarea and one...
5
by: jc | last post by:
Hi. I am in a situation with an engineering application involving monitoring of press operations. This involves storage of numbers for both an X and Y arrays. The number of element within the...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.