1. Read the values of a column in a row of a table in dataset:
Pnds. Tables ["memo"]. Rows [2]. ItemArray [1]. ToString ()
This example reads the values in the 3rd rows and 2nd columns of the memo table ..
Note: The calculation of rows and columns starts from 0...
2. Obtain the total number of columns (total number of columns) of a table in dataset)
Pnds. Tables ["memo"]. Columns. Count
3. Obtain the total number of rows of a table in dataset (that is, the number of records)
Pnds. Tables ["memo"]. Rows. Count
4. retrieve a column name of a table in dataset
Pnds. Tables ["memo"]. Columns [2]. ToString ()
This example obtains the column name of column 3rd in the memo table ..
4.
. NET uses MySQL Connector Net 1.0.6 to insert data to the MySql database with garbled characters:
Problem:
When Chinese data is inserted, garbled characters are displayed on the interface, and database data is garbled ????.
Solution:
Add the connection string CharSet = gb2312;
Example: string connStr = "server = 58.135.48.45; user id = root; password = password; database = mysql; CharSet = gb2312 ;";
Other problems:
The database query syntax is correct, that is, the returned results are empty, and all the query results in mysql-front are returned. At that time, I was confused about the problem and I was depressed for a long time! It was originally in character encoding;
Asp.net <META http-equiv = "content-type" content = "text/html; charset = gb2312">, and the mysql database encoding is changed to gb2312, the ODBC driver is also set names 'gb2312'; no results are returned, and then GB2312 is SET in the database connection string;
From this we can see that the. net interface character must be gb2312 passed to the database!
This problem is solved.
5. The DropDownList property autopastback client automatically calls the server and refreshes the interface! Bad!
Use JS to change!
The same problem occurs in. net Windwow Forms programming! Character encoding is still not done!