Overriding TableAdapter ConnectionString


/ Published in: C#
Save to your folder(s)

Overriding TableAdapter ConnectionString


Copy this code and paste it in your HTML
  1. namespace somepackage.MyDataSetTableAdapters
  2. {
  3. public partial class ClientsTableAdapter
  4. {
  5. public void SetCustomConnection(string connectionString)
  6. {
  7. System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
  8. conn.ConnectionString = connectionString;
  9. this.Connection = conn;
  10. }
  11. }
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.