Friday, February 4, 2011

c# connection.mod - App to save fcontrols from web pages in a folder.

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Data;
6 using System.Data.SqlClient;
7 namespace PageControlRegistry
8 {
9 class Connection
10 {
11
12 public SqlConnection runCon() {
13 SqlConnection conn = null;
14 try{
15 conn = new SqlConnection(@"Data Source='Mysqldev2005';Initial Catalog='MYDB';User Id='kathy';Password='password';");
16 conn.Open();
17 return conn;
18 }
19 catch{
20 if (conn != null) {
21 conn.Dispose();
22 }
23 return null;
24 }
25 }
26 }
27
28
29
30 }

No comments:

Post a Comment