hytos / DTI_PID / APIDConverter / DB / DB.cs @ 74a0c9d6
이력 | 보기 | 이력해설 | 다운로드 (995 Bytes)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Threading.Tasks; |
6 |
|
7 |
namespace AVEVA.PID.CustomizationUtility.DB |
8 |
{ |
9 |
public class DB |
10 |
{ |
11 |
public static string GetConnectionString() |
12 |
{ |
13 |
string strConn = string.Empty; |
14 |
if (Utilities.strSQLWinAuthentication.ToUpper() == "YES") |
15 |
{ |
16 |
strConn = String.Format("Data Source=" + Utilities.strSQLServerName + ";Integrated Security=SSPI;Initial Catalog={0};", Utilities.strSQLDatabaseName); |
17 |
} |
18 |
else if (Utilities.strSQLWinAuthentication.ToUpper() == "NO") |
19 |
{ |
20 |
string strAccessString = "User ID=" + Utilities.strSQLUserName + ";Password=" + Utilities.strSQLPassword; |
21 |
strConn = String.Format("Data Source=" + Utilities.strSQLServerName + ";Initial Catalog=" + Utilities.strSQLDatabaseName + ";" + strAccessString); |
22 |
} |
23 |
|
24 |
return strConn; |
25 |
} |
26 |
} |
27 |
} |