-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQL Connection
More file actions
26 lines (24 loc) · 753 Bytes
/
Copy pathSQL Connection
File metadata and controls
26 lines (24 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
private SqlConnection connectionStringBuilder()
{
try
{
SqlConnection conn = new SqlConnection(
new SqlConnectionStringBuilder()
{
DataSource = "localhost",
InitialCatalog = "",
UserID = "",
Password = "",
IntegratedSecurity = true
}.ConnectionString
);
conn.Open();
conn.Close();
return conn;
}
catch (Exception e)
{
MessageBox.Show(e.Message.ToString(),"Could not open SQL Connection");
}
return null;
}