Changing Connection String of DataEnvironment at runtime
If DataEnvironment1.Connection1.State = adStateOpen Then
DataEnvironment1.Connection1.Close
Else
DataEnvironment1.Connection1.ConnectionString = strConnString
DataEnvironment1.Connection1.Open
End If
strConnString= Data Provider=SQLOLEDB;Data Source=ServerAddress;Initial Catalog=DataBase;User ID=Username;Password=Password;
it will work when u r using single command but when u will use child command . it will show error to solve it u have change ur connection string by adding Data Shape as given below. Data Shape is used for relational database in report design.
strConnString= Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=erverAddress;Initial Catalog=DataBase;User ID=Username;Password=Password;
See
Subscribe to:
Post Comments (Atom)
1 comment:
Great it sworking fine
Post a Comment