1 // test whether the connection string is successful
2 # region
3 using System;
4 using System. Collections. Generic;
5 using System. Linq;
6 using System. Web;
7 using System. Web. UI;
8 using System. Web. UI. WebControls;
9 using System. Data. SqlClient;
10 using System. Configuration;
11
12 public partial class test_Default: System. Web. UI. Page
13 {
14 protected void Page_Load (object sender, EventArgs e)
15 {
16 string str = ConfigurationManager. ConnectionStrings ["haqiuConnectionString"]. ConnectionString;
17 SqlConnection strConn = new SqlConnection (str );
18 if (strConn = null)
19 {
20 Response. Write ("the connection string is empty! ");
21}
22 else
23 {
24 Response. Write ("the connection string is not empty! ");
25}
26}
27}
28 # endregion
29
30 // open the database connection
31 # region
32 using System;
33 using System. Collections. Generic;
34 using transaction E