QQ chat group: 13033480
When I first went to college, I was very excited and excited. One of the main points is the school library...
Hall, large ...;
Books, more...
In particular, the English version of the big part has never been used in the middle school.
I excitedly borrowed a book "Romance of the Three Kingdoms" and came back to carefully open it. I saw this sentence:
"Life is long "......
My heart is getting cooler ......
Pulling the cold and pulling the cold ............
Is this the famous qiangu sentence of Cao ????
"Life ry "????
Why can't I see this ????
Life is long... even if you translate it into me, life is long and a little bit interesting ......
It wasn't until I learned assembly language that I really realized what is literal translation or free translation...
There are three reading methods in assembly language. Correspondingly, there are three translation methods:
One is to read it in one sentence. In this way, we mainly look at whether there are any instructions that we are not familiar with in each sentence. If you translate them directly, you cannot read them;
One is: Reading data in one place, but it is a literal translation. It mainly refers to what operations are carried out in this section. It seems that the problem has been explained, but roilpead, you are tired of watching it yourself;
The third is reading data in one place, but it is a free translation. At this moment, you must truly see thatCodeWhat are you doing ??
The Assembly Language is like this. So should it be like this...
Let's take a look at this Code:
String connectionstring = "Server =. \ sqlexpress; database = netshop; trusted_connection = sspi "; string plain text =" select * from category "; sqlconnection conn = new sqlconnection (); Conn. connectionstring = connectionstring; sqlcommand cmd = new sqlcommand (); cmd. connection = conn; cmd. commandtype = commandtype. text; cmd. commandtext = plain text; Conn. open (); sqldatareader RDR = cmd. executereader (); While (RDR. read () {response. write (RDR ["name"] + "<br/>");} RDR. close (); Conn. close ();
There are eleven lines of code in these fourteen lines. We have already talked about it. I believe you can understand it. I don't need to talk about anything. Let's read this section. Let's have three lines of code:
Sqldatareader RDR = cmd. executereader ();
While (RDR. Read ())
{
Response. Write (RDR ["name"] + "<br/> ");
}
I. Reading in one sentence:
1. sqldatareader RDR = cmd. executereader ();
This statement declares a sqldatareader pointer pointing to a table obtained by CMD. executereader;
This table is a sqldatareader class. Here, it mainly stores data and contains several lines of code or functions to help us manage the data in this class.
2. While (RDR. Read ())
In this sentence, while, everyone is familiar with RDR. read () is the next row in the sqldatareader table. If the next row exists, true is returned. If the row does not exist or no data exists, false is returned.
The sqldatareader table data can only be read in one row, the row to which it is going forward, the row to be read, and the row to be connected.
3. response. Write (RDR ["name"] + "<br/> ");
This sentence is mainly the RDR ["name"]. It seems that you can guess it if you don't need to talk about anything. This is a row that reads data from the sqldatareader table, the value in "name.
2. Read data over a period of time:
This is a loop. For each loop, Judge RDR first. whether the value returned by read () is true. If it is true, it indicates that there is a row of data in the table. Then, the value of the "name" field in the row is read and displayed on the browser, if it is false, it indicates that the table does not have the next row of data, and the loop ends. Reading and translating in this way seems to be similar.
3. Reading data in a segment:
The key is to look at this section.
I translated it like this. This is a "traversal" that reads all the names in the sqldatareader table and displays them on the browser.
Concise and concise. It seems that there is still some flavor, isn't it ??
Yes, this is a traversal. Have you heard of brute force password cracking? Bloody, exciting, right? In fact, it is just a traversal. The essence of the process is to use all possible combinations of passwords, one by one, one by one.
A lot of loops you have learned before, from the array to the two-dimensional array, start to encounter nested loops, I believe that many new students have a big head. In fact, it is just a traversal. Each data in the array is accessed one by one.
Remember, what we learned today is "traversal". When we see this stuff later, you should be able to think of the chairman of the trade union and say, "Oh, it was the chairman of the trade union who went from house to learn about the people's sentiments and sent warmth ..... ", I will be more happy.
Copyright: 2012, westgarden. You are welcome to reprint it. Please indicate the source for reprinting. More Article See blog http://www.cnblogs.com/WestGarden/