<span id="Label3"></p><p><p>1.app.config (connection string):</p></p><p>Description: now that our connection string is no longer stored in a static field, it is saved in a name called<span style="font-family: Times New Roman;"><span style="font-family: Times New Roman;">App.</span></span><span style="font-family: 宋体;"><span style="font-family: 宋体;">file, the file</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">must be added at the <span style="font-family: Times New Roman;">UI</span> <span style="font-family: 宋体;">layer</span> </span></span>, but we know<span style="font-family: Times New Roman;"><span style="font-family: Times New Roman;">SQLHelper</span></span><span style="font-family: 宋体;"><span style="font-family: 宋体;">is in</span></span><span style="font-family: Times New Roman;"><span style="font-family: Times New Roman;">DAL</span></span><span style="font-family: 宋体;"><span style="font-family: 宋体;">layer is Created. You're in</span></span><span style="color: #ff0000; font-family: Times New Roman;"><span style="color: #ff0000; font-family: Times New Roman;">SQLHelper</span></span><span style="font-family: 宋体;"><span style="font-family: 宋体;"> <span style="color: #ff0000;">class</span> through the</span></span><span style="color: #ff0000; font-family: Times New Roman;"><span style="color: #ff0000; font-family: Times New Roman;">ConfigurationManager</span></span><span style="font-family: 宋体;"><span style="font-family: 宋体;">to parse</span></span><span style="font-family: Times New Roman;"><span style="font-family: Times New Roman;">App. config,</span></span><span style="font-family: 宋体;"><span style="font-family: 宋体;">Don't forget.</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">Introducing Namespaces</span></span>In<span style="font-family: Times New Roman;"><span style="font-family: Times New Roman;">. NET</span></span><span style="font-family: 宋体;"><span style="font-family: 宋体;">under the assembly, there is a</span></span><span style="font-family: Times New Roman;"><span style="font-family: Times New Roman;">System.Configuration</span></span><span style="font-family: 宋体;"><span style="font-family: 宋体;">name Space</span></span></p><p><p><span style="font-family: 宋体;">The following are the considerations for the implementation steps shown:</span></p></p><p><p><span style="font-family: 宋体;">1. Write code in the UI Layer's app. Config</span></p></p><p><p><span style="font-family: 宋体;"></span></p></p><p><p><span style="font-family: 宋体;">2. in Reference-assembly-reference System. Configuration</span></p></p><p><p><span style="font-family: 宋体;"></span></p></p><p><p><span style="font-family: 宋体;">3. Read the connection string information in app. Config and save it to the Variable.</span></p></p><p><p><span style="font-family: 宋体;"></span></p></p><p><p><span style="font-family: 宋体;">4. Note: Why should I add a namespace to a reference?</span></p></p><p><p><span style="font-family: 宋体;"></span></p></p><p><p>5. Note:</p></p><p><p></p></p><p><p>6.</p></p>ReadOnly<span style="font-family: 黑体;"><span style="font-family: 黑体;">and the</span></span><span style="font-family: Arial;"><span style="font-family: Arial;">Const</span></span><span style="font-family: 黑体;"><span style="font-family: 黑体;">the Difference</span></span><p><p>Once a constant is defined, changing the value of a constant is no longer allowed in subsequent Code.</p></p><p><p>01.readonly <span style="font-family: 宋体;">can exist only as a variable of a <span style="color: #ff0000;">class</span> , not as a variable of a method. </span></p></p><p><p>02.readonly is <span style="font-family: 宋体;">assigned at <span style="color: #ff0000;">run time</span> , and</span> <span style="font-family: Times New Roman;">const</span> <span style="font-family: 宋体;">is the value given to the constant at compile Time. </span></p></p><p><p>03.readonly <span style="font-family: 宋体;">can modify any type, whereas</span> a <span style="font-family: Times New Roman;">const</span> can <span style="font-family: 宋体;">only declare <span style="color: #ff0000;">a value type and a special reference type</span> </span> <span style="color: #ff0000; font-family: Times New Roman;">string</span><span style="font-family: 宋体;">. </span></p></p><p><p>Entity Class----app-config</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service