473,729 Members | 2,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Store database values in array

10 New Member
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 6469
iam_clint
1,208 Recognized Expert Top Contributor
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 New Member
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 Recognized Expert Top Contributor
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
2672
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 database. I wonder how i could connect a person to several other id's in a table. I wonder if I can make a string in the database that holds all the id's separated with , for example....?
11
2539
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 ------- ------- -------- ------- ----- ----- --- .... ... ... ... ... ... ... <Add item> <Submit>
11
3612
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 million lines. b) I need to store the contents into a unique hash. c) I need to then sort the data on a specific field. d) I need to pull out certain fields and report them to the user.
3
5044
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 (rP) in the DataList control has a link that takes the user to page C, where they can view the records in the child table corresponding to the selected row rP. Page C needs to repeat the values from rP at the top. Since I have already retreived...
10
5237
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
2862
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 Truncated. so we need a solution to store and retrieve user Entered value along with single quotes into the Database. i am using the String variable to frame the Qry(that is then passed to Database for execution) which is as follows
20
24190
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 database and store it in array. I need urgently ,Please help me.
9
19841
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 list boxes,now whenever user fill any value(email-Id) to textarea and press submit button then value going to listbox. These values are one or multiple , then they goes into list box , In list box these values are store in array . I mean user...
5
4064
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 arrays varies slightly but should be identical for a singular press operation. One approach is to store an element in a row. This would be 6000 rows (3000 elements/axis * 2). This seems excessive for a single operation. Also, I have no...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4528
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.