Shanghai fanko Information Technology Co., Ltd.

Source: Internet
Author: User

1. a = 5, B = (++ a) + (a ++), printf ("% d", B );

Answer: 19

 

2. Table students with id, classid, name, and score.

  • All students whose class is 4?

Answer: select * from students where classid = 4

  • Total number of students in each class?

Answer: select classid, count (*) as total from students group by classid

  • What is the highest score for each class?

Answer: select classid, max (score) as maxNumber from students group by classid

 

3. Use the database connection string Data Source = localhost; Initial Catalog = school; User ID = admin; Password = admin to display all Data in the students table;

Answer:

 

Code
Using System. Data. SqlClient;

Namespace WebApplication1
{
Public partial class DataReader: System. Web. UI. Page
{
Protected void Page_Load (object sender, EventArgs e)
{
String strConnection = "Data Source = localhost; Initial Catalog = InterviewExam; User Id = sa; Password = tingate587 ";
String strSQL = "select * from student ";

SqlConnection objConnection = new SqlConnection (strConnection );
SqlCommand objCommand = new SqlCommand (strSQL, objConnection );
ObjConnection. Open ();
SqlDataReader objReader = objCommand. ExecuteReader ();

While (objReader. Read ())
{
Response. Write (objReader ["Name"]. ToString ());
}

ObjConnection. Close ();
}
}
}

 

4. How do I call the variables in the. cs file on the aspx page?

Answer: <% = variable name %>

 

5. Write a javascript code to check that the name input box cannot be blank. The age input box can only contain numbers;

Answer:

 

6. Brief Introduction to CSS and DIV.

Answer:

 

7. There is a DATATABLE, how to achieve display without the server control.

Answer:

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.