当前位置:网站首页>C collection of questions for project review

C collection of questions for project review

2022-06-11 23:17:00 china_ zyb


Baidu SkyDrive : link : https://pan.baidu.com/s/1SAsX_ITj44q1YACE77Ys-A Extraction code : 2fhx

  1. first line using System What does that mean? ?

answer :using system; stay C# Refers to the meaning of namespace , Introducing a namespace is equivalent to Java Inside import java.util The role of the introduction package , Introduce namespace , You can use the variable names and functions .

For example, use StringBuilder class , You don't have to System.Text.StringBuilder builder = new System.Text.StringBuilder() 了 .


  1. namespace And what does that mean ?

answer : Namespace , amount to namespace amount to windows Folders in the operating system .“ Project name . Folder name ”, Used to subdivide files .


  1. Public And private Differences and functions of

answer :private It's completely private , It can only be called in the class itself , You can't call... Outside of a class or a subclass , A child class cannot inherit the parent class's private Properties and methods of .

public Fully open to all classes and members , Unlimited access .


  1. @ The role of symbols

answer :1. Ignore escape characters ,2. Make string cross line ,3. Usage in identifier :C# Is keyword not allowed as identifier ( Class name 、 Variable name 、 Method name 、 Tablespace name, etc ) The use of , But if you add @ After that .


  1. Explain it. delete Error reporting mechanism in methods , Operation process

answer :1、 Include code that anticipates that an exception might be thrown in try In the block .

2、 If something goes wrong , Then transfer in catch Implementation .

3、finally There can be no , There can be only one . Whether there is any abnormality or not , It will always run at the end of this exception handling structure . Even if you are in try In block return Back to , Before returning ,finally Always execute , This gives you the opportunity to do some cleanup at the end of exception handling . Such as closing database connection, etc .( without catch Sentence block , that finally Block is necessary .)


  1. Explain the placeholders {0}

answer : Receive the first parameter passed


  1. Explain what's in the parameter list box

answer : Declare a variable or class , Receive parameters from interface


  1. Explain it. sql sentence

answer : Inquire about x In the table a,b Column


  1. Datatable What is it? ?

answer :DataTable It is a grid virtual table that temporarily saves data ( A table representing data in memory .), Store the data queried from the database .


  1. String.format Explain it.

answer :string.format() Format specifiers , Specifies the String Each format item in the data of type is replaced by a text equivalent of the value of the corresponding object .


  1. Return Role in method

answer : Role in methods with return values :return Followed by return value , The return value type should be the same as the method return value type , Such as “public int intt()” Method return value type of is Int, be return The return value type followed must also be int.Return Assign return value to method , You can call values directly from the method. .

The function in the method without return value : End method run .


  1. return DBhelper.query(sql).Rows.Count; Explain it.

answer :return take DBHelper.query(sql) in DataTable The total number of rows of type data is returned to type Int Methods .


  1. public partial class Form1 : Form What does that mean? ?

answer : forms Form1 In the inheritance system Form Form format for .


  1. private void btnSubmit_Click(object sender, EventArgs e) Explain it. () Inside

answer : system parameter


  1. This   What is it? ?

answer : This form


  1. this.Close(); Explain it.

answer : Close this form


  1. private void StuChargeForm_Load(object sender, EventArgs e) Explain what happened

answer : Form load event , Occurs before the form is first displayed .


  1. DataSource What does it mean ?

answer : data source


  1. public void flush() void What does it mean ?

answer :void Indicates that the method does not return a value .


  1. Static What does it mean ? What's the role ?

answer : Static modifier , In the method ( function ) Pre use static modification , Indicates that this method is owned by the same class or by the same custom class , Not the instance of this class . Static methods can be called directly through classes , But you can't call a static method through an instance of this class , Because when calling static methods through entity classes , Object may not exist . Static methods cannot be overridden , Can only be overloaded , Because a static method does not belong to an instance object of a class .


  1. InitializeComponent(); What's the role 、?

answer : Initialize form control


  1. if (this.cboFlag.Text == " on-the-job ") t.flag = "1";

else if (this.cboFlag.Text == " quit ") t.flag = "2";

else if (this.cboFlag.Text == " vacation ") t.flag = "3"; Explain it. if Operation process of judgment

answer : A little


  1. this.lblPage.Text = " At present :" + page.nowPage + " page    common :" + page.getTotalPage() + " page   A total of :" + page.count + " strip ";   Medium + What does it mean ?

answer : Displays the current page and total number of pages in the page


  1. this.cboFlag.Text = " on-the-job "; cboFlag What controls are ?

answer : A drop-down box


  1. dgvTeacher.SelectedRows[0].Cells["teachid"].Value.ToString() Explain the line

answer :dgv In the first row of the selected row teachid Value in column converted to character creation type


  1. = And == The difference between

answer := It's assignment ,== Is a judgment


  1. int.Parse What are you doing ?

answer : take () The value in is replaced by int type


  1. this.cboTeacher.Items.Add(" All "); What are you doing ?

answer : Propagation to this form teacher Add an item to the options in the drop-down box ‘ All ’


  1. dt.Rows[0]["stuname"].ToString(); Explain the line

answer : hold dtz In the first line of stuname Change the value of column to character creation


  1. left join And inner join And right join What's the difference? ?

answer :left join( Left join ) Returns records that include all records in the left table and join fields in the right table ;

inner join( Equivalent connection ) Only rows with equal join fields in two tables are returned ;

right join( Right link ) Returns records that include all records in the right table and join fields in the left table .


  1. d.dormNum like '%{6}%' Explain it.    %- wildcard

answer : Fuzzy query  {6} Indicates the seventh parameter received ,%- Replace one or more characters .


  1. limit {0},{1} Explain the placeholders 0 and 1 The role of

answer :{0}  Indicates which data to display from ,{1} Indicates how many pieces of data are displayed per page


  1. Let's talk about some aggregate functions

answer :max,min,count,avg,sum


  1. Eight basic types

answer byte,short,int,long,float,double,bool,char


  1. Explain separately Sql Statement and and or 

answer : A little


  1. Priority with or without

Not > And > or


  1. Displaymember and valuemember The meaning of

answer :displaymember Fields to be displayed for binding ,valuemember Binding correspondence displaymember Value . Similar to key value pair .


  1. Why do I need to close the form new A new object

answer : Because of the creation of Factory class , All forms are from Factory Invocation in class , And Factory All forms in the class are static , Ensure the uniqueness of the form . When the form is closed ,Factory The value of the form instance object in class becomes Null, Next time from Factory When a form is called in a class , Will pop up Error, So when the form is closed , want new A new form is reserved for instance objects .


  1. if (i == j) () What is returned in ?

answer :true||false


  1. this.dgvstudent.SelectedRows.Count What is this ?

answer : How many lines are there


  1. Student s = new Student(); Why new A new object

answer : It is used to save the data entered by the user on the interface or to receive the data queried by the database .


  1. Delete requires call DBhelper Which method in , Why? ?

answer : Non query method , The non query method is responsible for connecting the non query statements to the database


  1. Why use +=? What does it do ?

answer : Give Way = The left value plus the right value is assigned to = The value on the left , Total charge amount


  1. if (this.rdoStudent.Checked) What will be returned ?

answer :true||false


  1. Page++ Medium ++ What does that mean? ?

answer : Increasing 1

  1. Mdiparent What's the role ?

answer : Set the parent form of the form


  1. Application.Exit() And this.close What's the difference? ?

answer :Application.Exit() Close all application windows , Terminate program operation ;Form.Close Method to close the form .


  1. Order by And group by The difference between ?Asc and desc The difference between ?

answer :groud by It has the function of sub combination and parallel . take groud by The following columns are grouped into one row according to the same row value , Carry out statistical work of the same data , Generally used in combination with aggregate functions .

Order by It has the function of sorting by conditions .Asc It's a positive order ,order by Positive sort by default ,desc For reverse order .

group by Than order by Execute first ,order by It won't be right group by Sort internally , If group by Only one record after , that order by Will be invalid .


  1. Textchanged What is it for ?

answer : Event when text changes


  1. Indexof What are you doing ? Back to what ?

answer : Returns the first occurrence of a specified string value in a string . If no characters are specified in the string , Then return to -1; If there is , Returns the position of the string .Indexof You can start the query from the specified location ,formindex The legal value range of 0 To stringobject.length-1.



原网站

版权声明
本文为[china_ zyb]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011604559309.html

随机推荐