"SELECT * FROM Employees where lastname= @charname";
THISCOMMAND.PARAMETERS.ADD ("@charname", s);
As you can see, the string s passes the parameter "Ddbolio" to the parameter Charname in the database action statement.
2. Read data from different tables in the database into dataset datasets
The SqlDataAdapter Fill method fills a known dataset and creates a temporary table for each fill item that can be read from the data set by access to that table. The related actions are as follows:
As you can see, in the DataSet DS, new students become two temporary tables "myemployees" and "mycustomers". To verify that the data in the two tables are indeed read into the DataSet DS, assign the first row of the table "MyEmployees" in the Tables "HireDate" to the character variable T1 with the data read operation, and the table "Mycustomers" corresponds to the property "ContactTitle" The first line is assigned to the character variable T2, and the variables are displayed in the pop-up window by the Javastript function "alert ()". The Page.registerstartupscript method is used to emit a client script block whose first parameter is a flag bit, the user can select any, and the second parameter is a JavaScript script, where the alert function pops up the MessageBox dialog box, and we pass the parameters T1 and T2 into the script So that it is displayed in the MessageBox.
PS: Because the network speed is too slow, the relevant display chart can not be uploaded to the server, really a great regret. There's also the style and format of not knowing how to write code that makes the code look messy.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.