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: