Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Data.SqlClient;
- //WinForm
- using System.Configuration;
- string winFormConnectString = ConfigurationManager.ConnectionStrings["Your DB Name"].ConnectionString;
- //WebForm
- System.Web.Configuration;
- string webFormConnectString = WebConfigurationManager.ConnectionStrings["Your DB Name"].ConnectionString;
- SqlConnection connection = new SqlConnection(winFormConnectString);
- //或是 SqlConnection connection = new SqlConnection(webFormConnectString);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement