I am using Com+ object pooling in my application .I specified the attribute for connection string using
< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
[Transaction(TransactionOption.Required),ObjectPooling(MinPoolSize=-1,MaxPoolSize=3),
JustInTimeActivation(true),SecurityRole("Authorized Users",false),
ConstructionEnabled(Default="Provider=OraOLEDB.Oracle;data source=DBOracle;uid=XXX;password=XXXXXX")]
Then later on I modified it to
[Transaction(TransactionOption.Required),ObjectPooling(MinPoolSize=-1,MaxPoolSize=3),
JustInTimeActivation(true),SecurityRole("Authorized Users",false),
ConstructionEnabled(Default="SERVER=ps2900;database=DotNet;uid=XXX;password=XXXXXX")]
Then I compiled my application into a dll and referenced it another application.But when I try to invoke the method connecting to the back end it gives me an exception stating

Com+ Error
Rabtok
Nonetheless given your original posting the problem is that "uid" in your connection string is not a valid SQL parameter. Change it to "user id" and it should work.
Michael Taylor - 10/19/05
Kinetic Media
Taking a shot at what I see I notice that you were originally connecting to Oracle and you have since switched to SQL Did your constructor get updated to use SqlConnection instead of OracleConnection. If not then the problem would be that your connection string is invalid for an Oracle DB. I don't think uid is valid for SQL. I believe it is "User Id".
There is a little VBScript floating around the web called GetConnString that I use to generate connection strings. Basically it invokes the ODBC tool to generate a standard connection string and then dumps it to the console. You could use it to generate a correct connection string instead of trying to guess the params. Unfortunately conn strings are standard across the board.
Hope this helps,
Michael Taylor - 10/18/05
SunilKannan
I have changed the parameter uid in the connection string but it does not solve the problem.My connectin string is (i still get the runtime exception stating Unknown connection option in connection string :Provider)
[Transaction(TransactionOption.Required),ObjectPooling(MinPoolSize=-1,MaxPoolSize=3),
JustInTimeActivation(
true),SecurityRole("Authorized Users",false),ConstructionEnabled(Default="SERVER=ps2900;database=DotNet;user id=XX;password=XXXXXX")]
Thanks and regards
Rohit
_Raj_
This is the code which i am using
Library_Comnamespace
{
[Transaction(TransactionOption.Required),ObjectPooling(MinPoolSize=-1,MaxPoolSize=3),
JustInTimeActivation(
true),SecurityRole("Authorized Users",false),ConstructionEnabled(Default="SERVER=ps2900;database=DotNet;uid=sa;password=s86/219thst")]
public class Library:ServicedComponent{
public SqlConnection o_conn=new SqlConnection(); private string Connectionstring; public Library(){} protected override void Construct(string construct_string){Connectionstring=construct_string;}
[AutoComplete()]
public void FetchDeparment(string S_name,string S_status){
string command_text="insert into Student_1 values(" + S_name + "," + S_status+")";SqlCommand o_comm=
new SqlCommand();o_comm.CommandText=command_text;
o_comm.Connection=o_conn;
if(o_conn.State==ConnectionState.Closed)o_conn.ConnectionString=Connectionstring;
o_conn.Open();
SqlDataAdapter o_adapter=
new SqlDataAdapter(o_comm);o_comm.ExecuteNonQuery();
o_conn.Close();
}
//end of method fetchDepartment}
//end of class Library}
//end of namespace(2)I had read somewhere that object pools using Com+ persist beyond the life of the applications that actually created those pools.Can you please let me know how this happens internally
Thanks and regards
Rohit
Doc Glazer
Michael Taylor - 10/20/05