通过预处理器指令调整连接的数据库
开发程序的时候可能会用到多个数据库,比如一个客户正在使用的数据库,一个测试数据库。开发中可能经常在这两套数据库中切换,从前我的做法是修改web.config文件,但是这样确实不太方便。最近发现可以通过预处理器指令来方便的调整。 先在web.config中分别定
开发程序的时候可能会用到多个数据库,比如一个客户正在使用的数据库,一个测试数据库。开发中可能经常在这两套数据库中切换,从前我的做法是修改web.config文件,但是这样确实不太方便。最近发现可以通过预处理器指令来方便的调整。
先在web.config中分别定义两个数据库的连接字符串
OracleHouseConnectionStringTest
OracleHouseConnectionString
获取字符串的地方修改如下
public static string OracleWaterGasConnectString
{
get
{
#if DEBUG
return Utility.GetConfig("OracleWaterGasConnectionStringTest");
#else
return Utility.GetConfig("OracleWaterGasConnectionString");
#endif
}
}
然后进行如下设置 添加两个配置.
以后调整数据库只需要更改 启动 按钮右边的配置就可以了.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



According to news from this website on July 28, foreign media TechRader reported that Fujitsu introduced in detail the FUJITSU-MONAKA (hereinafter referred to as MONAKA) processor planned to be shipped in 2027. MONAKACPU is based on the "cloud native 3D many-core" architecture and adopts the Arm instruction set. It is oriented to the data center, edge and telecommunications fields. It is suitable for AI computing and can realize mainframe-level RAS1. Fujitsu said that MONAKA will achieve a leap in energy efficiency and performance: thanks to technologies such as ultra-low voltage (ULV) technology, the CPU can achieve 2 times the energy efficiency of competing products in 2027, and cooling does not require water cooling; in addition, the application performance of the processor It can also reach twice as much as your opponent. In terms of instructions, MONAKA is equipped with vector

According to news from this site on August 10, AMD officially confirmed that some EPYC and Ryzen processors have a new vulnerability called "Sinkclose" with the code "CVE-2023-31315", which may involve millions of AMD users around the world. So, what is Sinkclose? According to a report by WIRED, the vulnerability allows intruders to run malicious code in "System Management Mode (SMM)." Allegedly, intruders can use a type of malware called a bootkit to take control of the other party's system, and this malware cannot be detected by anti-virus software. Note from this site: System Management Mode (SMM) is a special CPU working mode designed to achieve advanced power management and operating system independent functions.

According to news from this website on August 21, technology media WccFtech reported today that the Intel Core Ultra9285K "ArrowLake" processor appeared in the GeekBench6 benchmark library, surpassing the Core i9-14900KS and Ryzen99950X processors. Test platform The test platform exposed this time is ASUS ROGSTRIXZ890-AGamingWIFI motherboard and 64GBDDR5-6400 memory. Introduction to the Intel Core Ultra9285K "ArrowLake-S" desktop processor. The PL1 power consumption of the Intel Core Ultra9285K processor is 125W and it uses a 7nm process (CPU-Z information, it should actually use UK

According to news from this site on August 3, Intel issued another statement on August 2 in response to some media speculation about via oxidation (ViaOxidation), emphasizing that this is not the cause of instability in the 13th/14th generation processors. Intel said the speculation was somewhat misleading, and while it acknowledged there were issues early in product development, those issues have since been mitigated. This site translates Intel's official statement as follows: The via oxidation (ViaOxidation) currently reported in the media is only a minor problem. By improving the production process and screening in early 2023, this problem has been solved. This [via oxidation] issue was discovered in late 2022, and as Intel improved its manufacturing process, deployment

According to news from this site on August 14, two of the AMD Ryzen 9000 series desktop processors (R59600X and R79700X) were officially launched on August 8, priced at 1,949 yuan and 2,549 yuan respectively. Although the TDP of these two processors has been significantly reduced (65W) and the initial price has also been reduced, compared with the previous generation Ryzen 7000 series, the performance has only been improved by about 10% or even single-digit percentages. This is for some users who are more performance-oriented. It may be difficult for players to accept it. Considering this situation, it may be a good solution to let players decide the level of performance release. @g01d3nm4ng0 said that AMD will pass the AGESA1.2.0.1aPatchA microcode patch to Ryzen

News from this site on August 13, according to the latest report from market research organization Mercury Research, AMD once again achieved excellent results in the second quarter of 2024, with its market share in both data centers and laptop CPUs increasing. However, Intel has improved its desktop market share and continues to lead in overall shipments. Client PC market share in the second quarter of 2024 Intel: 78.9% AMD: 21.1% Compared to Intel, Intel continues to dominate the market, in line with expectations. AMD's shipment share increased by 0.5% month-on-month and 3.8% year-on-year. AMD is expected to take several years to fully turn around the market, and here's why: Intel's dominance in enterprise PC sales. Intel has a huge

The difference between multithreading and asynchronous is that multithreading executes multiple threads at the same time, while asynchronously performs operations without blocking the current thread. Multithreading is used for compute-intensive tasks, while asynchronously is used for user interaction. The advantage of multi-threading is to improve computing performance, while the advantage of asynchronous is to not block UI threads. Choosing multithreading or asynchronous depends on the nature of the task: Computation-intensive tasks use multithreading, tasks that interact with external resources and need to keep UI responsiveness use asynchronous.

According to news on September 2, according to the latest report released by Canalys, a well-known independent analysis agency for the technology market, in the second quarter of 2024, smartphone processor manufacturer data shows (based on smartphone shipments): MediaTek continues to maintain its position as the leading processor manufacturer. , shipments reached 115.3 million units, a year-on-year increase of 7%. Qualcomm ranked second, shipping 71 million units in the quarter, a year-on-year increase of 6%. Apple shipped 46 million units, a year-on-year increase of 6%, ranking third. Unisoc has strengthened its presence in the entry-level market, shipping 25 million units, a year-on-year increase of 42%, ranking fourth. Samsung shipped 17 million units, a year-on-year increase of 9%; ranking fifth; HiSilicon returned and shipped 8 million units in the second quarter, ranking sixth. Google Tenso
