WEB开发网
开发学院数据库MSSQL Server 基于SQL Server 的Exception Handling - PART II 阅读

基于SQL Server 的Exception Handling - PART II

 2008-12-06 10:15:28 来源:WEB开发网   
核心提示: 6.Programsclass Program{static void Main(string[] args){Utility.Clear();if (Utility.CreateUser("Artech")){Console.WriteLine("The u

6.   Programs

class Program
  {
    static void Main(string[] args)
    {
      Utility.Clear();
      if (Utility.CreateUser("Artech"))
      {
        Console.WriteLine("The user "{0}" has been sucessully created!", "Artech");
      }
      if (Utility.CreateUser("Artech"))
      {
        Console.WriteLine("The user "{0}" has been sucessully created!", "Artech");
      }
      if (Utility.CreateRole("Administrator"))
      {
        Console.WriteLine("nThe role "{0}" has been sucessully created!", "Administrator");
      }
      if (Utility.CreateRole("Administrator"))
      {
        Console.WriteLine("The role "{0}" has been sucessully created!", "Administrator");
      }
      if (Utility.AddUserInRole("Artech", "Administrator"))
      {
        Console.WriteLine("nThe user "{0}" has been successfully added in the role "{1}"", "Artech", "Administrator");
      }
  
      if (Utility.AddUserInRole("Dave Crane", "Administrator"))
      {
        Console.WriteLine("The user "{0}" has been successfully added in the role "{1}"", "Dave Crane", "Administrator");
      }
  
      if (Utility.AddUserInRole("Artech", "Super Administrator"))
      {
        Console.WriteLine("The user "{0}" has been successfully added in the role "{1}"", "Artech", "Super Administrator");
      }
  
      if (Utility.AddUserInRole("Artech", "Administrator"))
      {
        Console.WriteLine("The user "{0}" has been successfully added in the role "{1}"", "Artech", "Administrator");
      }
    }

7.  最终执行结果

基于SQL Server 的Exception Handling - PART II

上一页  4 5 6 7 8 9 

Tags:基于 SQL Server

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接