naming namespaces and classes in C# RRS feed

  • Question

  • User-1650322536 posted

    I'm a bit confused about how to name namespaces and classes for data tables.  Could you please let me know if I have this correct. 

    Suppose for example I have a table named Customers

    1.  Name the Namespace: Customers

    2.   Name the Class: Customer

    3.   Set public variables for each field in the class with: for example public String CustomerName { get: set}

    4.   Name the Constructor Method: Customer() and in it initialize each field with for example (e.g. CustomerID = null; )

    5.   Name the Destructor Method ~Customer().  Should there be any  code in the Destructor Method?

    6.  Create Class methods in the class below the Destructor for example:

           public static Boolean setCreditLimit(Int CustomerID, Int CreditLimit) {...}

    AS you can see, I'm totally confused.  I have been searching for an article that describes how to use classes for tables and data and have found all kinds of advanced discussions.  Do you know of any articles or books that cover this topic at a real simple level?

    Some more questions.

    7.  How does the Customer Class get associated with the Customer Table?

    8.  If I use a bound control (FormView) and SqlDataSource to insert, update and delete the Customer data, do I need t have a Customer Class to insert and delete data?

    9.  If I'm not using Add, Edit, and Delete methods, do I need to declare the Classes Variables?






    Friday, June 21, 2013 2:18 PM