I'm working on a small Windows Forms app (using VS 2005) where I use a single dataset reading multiple tables from a SQL Server (2000). Using the "My Project" interface, I changed the value of the datasource to point to a new database (dev to prod) and now my application is generating the following error message.
Error Message:
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken = b77a5c561934e089' failed.
I made certain to keep the same Name, Type, & Scope on the dataset... I simply changed the Catalog Name and User Id.
Any ideas where I went wrong
This is a before and after example of my datasource string:
Before:
Data Source=SQLDS0015;Initial Catalog=PVF_DEV;Persist Security Info=True;User ID=UserName1a;Password=Password1a
After:
Data Source=SQLDS0015;Initial Catalog=PVF_PROD;Persist Security Info=True;User ID=UserName1b;Password=Password1b
Also, this is a full trust application using ClickOnce to deploy.

Lost my Data
satya31237
The SQL connection object has a change database method:
Public Overrides Sub ChangeDatabase(ByVal database As
String)Member of:
System.Data.SqlClient.SqlConnectionSummary:
Changes the current database for an open System.Data.SqlClient.SqlConnection.
Parameters:
database: The name of the database to use instead of the current database.
Exceptions:
System.Data.SqlClient.SqlException: Cannot change the database.
System.InvalidOperationException: The connection is not open.
System.ArgumentException: The database name is not valid.
johnnyjunky
You need to locate in your project where the SqlClientPermission class is initialized and call the SqlClientPermission.Add method of the SqlClientPermission class to add the new connection string. Most likely the wizard created the first instance for you and now you need to add the new connection string.
http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlclientpermission.add.aspx