locked
namespaces ? RRS feed

  • Question

  • User-620767395 posted

    Hi,

    I guess how would I make sure namespace is added to my project? I understand with a normal VB project you would look into the "myproject" section of the solution to see all imported namespaces and wheatear they are checked or not... I am loss and don’t know where to go in this type of solution which does not feature myproject selection. 


    thanks

    Wednesday, January 23, 2013 9:17 PM

Answers

  • User614805505 posted

    Import a namespace make variable/functions declaration easier. For an example, when you want to use SqlConnection, you can either import  System.Data.SqlClient namespace, then use Dim conn as SqlConnection

    or

    use Dim conn as System.Data.SqlClient.SqlConnection without any namespace imported.

    So, what namespaces to import is actually depend on how you want to code.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 24, 2013 10:13 AM

All replies

  • User614805505 posted

    Hi,

    Let make it simple, you can construct project namespace by following below guide line.

    CompanyName.SolutionName.ProjectName

    This will make sense if you have multiple projects in a solution. Especially when you are design your solution with multi tiers.

    Thursday, January 24, 2013 12:34 AM
  • User-620767395 posted

    Hi,

    Thanks for the guide line feedback; however, where would I find all imported namespaces for and asp project? As I mention above within a Visual Basic project there is a "my project" which allows me to see all of imported namespaces and which ones are selected. so my question is when developing dynamic data website where would I look to find my imported namespaces?

    Thursday, January 24, 2013 9:42 AM
  • User614805505 posted

    Import a namespace make variable/functions declaration easier. For an example, when you want to use SqlConnection, you can either import  System.Data.SqlClient namespace, then use Dim conn as SqlConnection

    or

    use Dim conn as System.Data.SqlClient.SqlConnection without any namespace imported.

    So, what namespaces to import is actually depend on how you want to code.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 24, 2013 10:13 AM