All
All
Books
Books
Engineering
Engineering
God
God
Hardware
Hardware
Improvement
Improvement
Programming
Programming
Questions
Questions
Software
Software

How To Load Multiple Records In An Array Using VB ASP.NET?




Multiple Records In An Array - VB ASP.NET

This article is a continuation of our discussion on the topic of building Oracle TimesTen In-memory database which costs 23,000 USD: URL. We have already discussed, How To Load A Single Record In An Array Using VB ASP.NET (URL) and How To Pass An Array From A Function In A Normal Program Flow (URL). The code snippet shown here is a generic function to load multiple records in an array, more specifically 2-dimensional array. We have named the function as GeneralDataReaderMultiple () and it takes three arguments: 'SQL', 'MaxRecordNo' and 'MinRecordNo'. Minimum and Maximum record number is used for recordset pagination; according to wikipedia:

On the Internet, pagination is used for such things as displaying a limited number of results on search engine results pages, or showing a limited number of posts when viewing a forum thread. Pagination is used in some form in almost every web application to divide returned data and display it on multiple pages. Read more: URL

You will better understand the purpose of 'MaxRecordNo' and 'MinRecordNo' when we call this funtion from a normal program flow in the next article. The few Replace functions in the begining will help create deterance against 'SQL Injection' attacks.

SQL injection is a code injection technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered ... -Wikipedia URL

If everything goes smoothly, the resultant 2-dimensional array will contain the records extracted from the database otherwise it will contain "Error" keyword. Server.HtmlEncode() and stripHTML() will provide protection against XSS attacks. After the load process is complete we will immediately close the connection with the database. Next we will learn how to call this function from normal program flow.

 Source: http://www.progneer.com/wp/137227
Table of Contents
§ How To Build Your Own Oracle TimesTen In-Memory Database Using VB ASP.NET?
  → Overview, Planning And Precautions
  → How To Load A Single Record In An Array Using VB ASP.NET?
     → How To Pass An Array From A Function In A Normal Program Flow?
  → How To Load Multiple Records In An Array Using VB ASP.NET? << You Are Here
Date Posted 03/31/2011 Filter Questions Add to your favorites  Follow Bookmark and Share



How To Pass An Array From A Function In A Normal Program Flow?




Calling GeneralDotNetSqlDataReader(SQL)

This article is a continuation of previous article: How To Load A Single Record In An Array Using VB ASP.NET? URL where we learnt about how to write a generic function which can help us load a single record into an array from any ODBC database. Such generic function is useful because we can extract information from database and then immediately close the connection. Here we have shown that how we to call GeneralDotNetSqlDataReader(SQL) function in a normal program flow. The array generated by the function will be loaded in vResult -a String array variable, defined at the start of the code using Dim command. In case the SQL statement results in no record or an error then the 'Else' part of the code will be executed otherwise the session variable: AccessLevel will be assigned a value of 'access_level' field of dbadmin.person table. In the next article we will look into how to load multiple records from Oracle/any data source in an array. Again we will write a generic function so that you can easily copy and paste in your software program with little or no modification. Loading multiple records in an array will be like running Oracle TimeTen In-Memory database at no cost. I am having difficulty understanding, how Oracle came up with 23,000 USD for Oracle TimeTen In-Memory license fee. Maybe the product name sounds scary.

 Source: http://www.progneer.com/wp/137235
Table of Contents
§ How To Build Your Own Oracle TimesTen In-Memory Database Using VB ASP.NET?
  → Overview, Planning And Precautions
  → How To Load A Single Record In An Array Using VB ASP.NET?
     → How To Pass An Array From A Function In A Normal Program Flow? << You Are Here
  → How To Load Multiple Records In An Array Using VB ASP.NET?
Date Posted 03/29/2011 Filter Questions Add to your favorites  Follow Bookmark and Share



How To Load A Single Record In An Array Using VB ASP.NET?




How To Load A Single Record In An Array Using VB?

If you notice, we have used Server.HtmlEncode() and stripHTML() in order to avoid Cross-site scripting (XSS) attacks. To read more about XSS visit http://msdn.microsoft.com/en-us/library/ff649310.aspx. XSS occurs when someone submits a script e.g. javascript on your website data-entry form. Now once you or anyone view that data-entry using Internet Explorer/FireFox; the browser will take it as if the javascript was already on the page and not the part of dynamic data came straight from the database. With Server.HtmlEncode() and stripHTML() all the scripting tags will be converted to HTML equivalent and leftover HTML tags will be striped as a second line of protection. On the other hand, few Replace() funtions at the start of GeneralDotNetSqlDataReader() will make sure that incoming SQL statement is not embedded with SQL Injection prone characters. Under the Source link, I have provided URL in case you want to read more about SQL injection attacks. Next we will look into how to use this function in a normal code flow.

 Source: http://msdn.microsoft.com/en-us/library/ms161953.aspx
Table of Contents
§ How To Build Your Own Oracle TimesTen In-Memory Database Using VB ASP.NET?
  → Overview, Planning And Precautions
  → How To Load A Single Record In An Array Using VB ASP.NET? << You Are Here
     → How To Pass An Array From A Function In A Normal Program Flow?
  → How To Load Multiple Records In An Array Using VB ASP.NET?
Date Posted 03/17/2011 Filter Questions Add to your favorites  Follow Bookmark and Share



Overview, Planning And Precautions




Dataset Size Should Be Less Than Total RAM Size

First we will look at different ways of loading an Oracle dataset in a VB ASP.NET array. We will share some generic functions which will help you achieve this goal. Then we lean how to call these functions from within the normal code flow. These functions are tested against Oracle database with built-in SQL-Injection protection, Pagination functionality, Error handling and generic to an extent that all you need is to provide the SQL statement and connect string. Once we have the technology of loading Oracle dataset in VB ASP.NET array then we look into how to load all the dataset at the start of the application.

Please make sure your physical RAM size is well above the limit of your dataset (you are planning to load in an array) in terms of bytes otherwise Windows will create the Virtual RAM but if it is even over the Virtual RAM limit then your Windows OS will freeze.

Virtual RAM a.k.a. PageFile; to read more about PageFile visit URL. If you try to load dataset of 1TB in an array with a RAM of your PC being 4 GB and max virtual RAM size as 4 GB; your system will crash/freeze and most likely you will end up rebooting your computer. I have provided a URL under Source link, in case you want to learn more or refresh your knowledge about arrays, more specifically Visual Basic arrays.

 Source: http://msdn.microsoft.com/en-us/library/wak0wfyt.aspx
Table of Contents
§ How To Build Your Own Oracle TimesTen In-Memory Database Using VB ASP.NET?
  → Overview, Planning And Precautions << You Are Here
  → How To Load A Single Record In An Array Using VB ASP.NET?
     → How To Pass An Array From A Function In A Normal Program Flow?
  → How To Load Multiple Records In An Array Using VB ASP.NET?
Date Posted 03/17/2011 Filter Questions Add to your favorites  Follow Bookmark and Share



How To Build Your Own Oracle TimesTen In-Memory Database Using VB ASP.NET?




Larry Have Some Mercy: TimesTen For 23,000 USD?

Oracle Database is the most expensive RDBMS software in the world-wide market. Just to give you an idea, Oracle 11g Standard One Edition processor based license (dual socket or quad core) perpetual, costs 6,200 USD. Standard One is lowest, lower end or in other words small business solution. They also have Oracle Standard and Oracle Enterprise Edition Database, where later being the most expensive among the three. Now let's look at Oracle TimeTen In-memory database; it costs 23,000 USD processor based license as of March 2011. This is ridiculus, isn't it? It shows how Larry Ellison is one of the richest guys in competition to build world biggest yacht. In words of Oracle:

Oracle TimesTen In-Memory Database (TimesTen) is a memory-optimized relational database that delivers very low response time and very high throughput for performance-critical systems.

It is basically Oracle's standard database with the only one major difference that at the start, almost all or at least most of the dataset is loaded in the RAM. These days RAM chips are dirt chip compared to years back. You can have a server with 64 GB RAM or 128 GB RAM or an enterprise level server with 512 GB RAM and then load the whole dataset in an array at the start of the application. Then serve all the connected sessions via this dataset array. Let's dive in. Prerequisites: VB ASP.NET, Arrays, ADO.NET, Oracle.

 Source: http://www.Oracle.com
Table of Contents
§ How To Build Your Own Oracle TimesTen In-Memory Database Using VB ASP.NET? << You Are Here
  → Overview, Planning And Precautions
  → How To Load A Single Record In An Array Using VB ASP.NET?
     → How To Pass An Array From A Function In A Normal Program Flow?
  → How To Load Multiple Records In An Array Using VB ASP.NET?
Date Posted 03/13/2011 Filter Questions Add to your favorites  Follow Bookmark and Share



What Is Devil Trojan Horse Trojan Behind UDP Port Number 65000?


Under normal conditions UDP Port Number 65000 is used for non-malicious activity by installed software on your computer but if your computer is infected by Devil Trojan Horse malware then this port is utilized for malicious activity implicitly. All trojans are malware but not all malwares are trojan. The word trojan came from a greek myth when the army had a seige outside Troy castle for years but they were not successful to get in then they finally decided to make a Trojan Horse and hid fine soldiers in it. When Troy people took it inside their castle that is how the castle got concurred. On the same lines trojan malwares enter into computer by first bluffing Firewall. So even with Firewall running you need to have antispyware or anti-malware software up and running all the time.

 Source: http://en.wikipedia.org/wiki/Trojan_horse_(computing)
Date Posted 11/06/2010 Filter Questions Add to your favorites  Follow Bookmark and Share



What Is Stacheldraht Trojan Behind TCP Port Number 65000?


Under normal conditions TCP Port Number 65000 is used for non-malicious activity by installed software on your computer but if your computer is infected by Stacheldraht malware then this port is utilized for malicious activity implicitly. All trojans are malware but not all malwares are trojan. The word trojan came from a greek myth when the army had a seige outside Troy castle for years but they were not successful to get in then they finally decided to make a Trojan Horse and hid fine soldiers in it. When Troy people took it inside their castle that is how the castle got concurred. On the same lines trojan malwares enter into computer by first bluffing Firewall. So even with Firewall running you need to have antispyware or anti-malware software up and running all the time.

 Source: http://en.wikipedia.org/wiki/Trojan_horse_(computing)
Date Posted 11/06/2010 Filter Questions Add to your favorites  Follow Bookmark and Share



What Is Devil Trojan Horse Trojan Behind TCP Port Number 65000?


Under normal conditions TCP Port Number 65000 is used for non-malicious activity by installed software on your computer but if your computer is infected by Devil Trojan Horse malware then this port is utilized for malicious activity implicitly. All trojans are malware but not all malwares are trojan. The word trojan came from a greek myth when the army had a seige outside Troy castle for years but they were not successful to get in then they finally decided to make a Trojan Horse and hid fine soldiers in it. When Troy people took it inside their castle that is how the castle got concurred. On the same lines trojan malwares enter into computer by first bluffing Firewall. So even with Firewall running you need to have antispyware or anti-malware software up and running all the time.

 Source: http://en.wikipedia.org/wiki/Trojan_horse_(computing)
Date Posted 11/06/2010 Filter Questions Add to your favorites  Follow Bookmark and Share



What Is Devil Trojan Behind TCP Port Number 65000?


Under normal conditions TCP Port Number 65000 is used for non-malicious activity by installed software on your computer but if your computer is infected by Devil malware then this port is utilized for malicious activity implicitly. All trojans are malware but not all malwares are trojan. The word trojan came from a greek myth when the army had a seige outside Troy castle for years but they were not successful to get in then they finally decided to make a Trojan Horse and hid fine soldiers in it. When Troy people took it inside their castle that is how the castle got concurred. On the same lines trojan malwares enter into computer by first bluffing Firewall. So even with Firewall running you need to have antispyware or anti-malware software up and running all the time.

 Source: http://en.wikipedia.org/wiki/Trojan_horse_(computing)
Date Posted 11/06/2010 Filter Questions Add to your favorites  Follow Bookmark and Share



What Is Bunker-Hill Trojan Trojan Behind TCP Port Number 63485?


Under normal conditions TCP Port Number 63485 is used for non-malicious activity by installed software on your computer but if your computer is infected by Bunker-Hill Trojan malware then this port is utilized for malicious activity implicitly. All trojans are malware but not all malwares are trojan. The word trojan came from a greek myth when the army had a seige outside Troy castle for years but they were not successful to get in then they finally decided to make a Trojan Horse and hid fine soldiers in it. When Troy people took it inside their castle that is how the castle got concurred. On the same lines trojan malwares enter into computer by first bluffing Firewall. So even with Firewall running you need to have antispyware or anti-malware software up and running all the time.

 Source: http://en.wikipedia.org/wiki/Trojan_horse_(computing)
Date Posted 11/06/2010 Filter Questions Add to your favorites  Follow Bookmark and Share




Next





      
 
        Show All  
 
Total Progneers Total Views: 682363
 
Total Articles Total Articles: 58752
     Last Week:0
     Last Month:1
 
Total Progneers Total Comments: 85

 
iron's Image

Name:
Asim Abbasi

Interests:
.NET, VB, Ping Pong, Movies,
Thinking

Website:
http://www.takveen.com...


Since 01/23/2011


Comments  Send Message