收集的.net笔试题

来源:互联网 发布:英语六级听力软件音频 编辑:程序博客网 时间:2024/04/28 07:39

.net笔试题


姓名:                      日期:

1.      填空: (1)面向对象的语言具有________性、_________性、________性。

        (2)能用foreach遍历访问的对象需要实现 ________________接口或声明________________方法的类型。

        (3)列举ADO.net中的五个主要对象_______________、_____________、_______________、_______________、_________________。

2. 不定项选择:

(1) 以下叙述正确的是:

      A. 接口中可以有虚方法。     B. 一个类可以实现多个接口。
      C. 接口不能被实例化。       D. 接口中可以包含已实现的方法。

   (2) 从数据库读取记录,你可能用到的方法有:

      A. ExecuteNonQuery            B. ExecuteScalar

      C. Fill                        D. ExecuteReader

3. 简述 private、 protected、 public、 internal 修饰符的访问权限。


4. 写出一条Sql语句: 取出表A中第31到第40记录(SQLServer, 以自动增长的ID作为主键,  注意:ID可能不是连续的。)


5 .列举ASP.NET 页面之间传递值的几种方式。


6. 写出程序的输出结果

class Class1  {
       private string str = "Class1.str";
       private int i = 0;
       static void StringConvert(string str)  {
           str = "string being converted.";
       }
       static void StringConvert(Class1 c)  {
           c.str = "string being converted.";
       }
       static void Add(int i)  {
           i++;
       }
       static void AddWithRef(ref int i)  {
           i++;
       }
       static void Main()  {
           int i1 = 10;
           int i2 = 20;