Dear,
You can use DifferentDatabaseScope.
- DifferentDatabaseScope: replaces the connection used by NHibernate
with one provided by your code, thus forcing the underlying operations to
happen in a different database
IDbConnection connection = new SqlConnection("Data Source=.;Initial
Catalog=TestB;Integrated Security=SSPI");
connection.Open();
using (new DifferentDatabaseScope(connection))
{
TestTableDatabaseA test3 = TestTableDatabaseA.Find(1);
Console.WriteLine(test3.Title);
}
http://old.castleproject.org/activerecord/documentation/v1rc1/manual/scopes.html
*
*
http://www.darkside.co.za/archive/2008/01/21/castle-activerecord-connecting-to-multiple-databases.aspx
On Wed, Aug 7, 2013 at 5:14 AM, 彭典 <[email protected]> wrote:
> Dear
> I want to achieve the following functions: The system has three users,
> each user has their own separate database, the data are written to the
> database in which the user belongs, there is no interference between users,
> how can I do?
> Nice day.
> Thanks.
>
> 在 2013年8月6日星期二UTC+8下午8时38分16秒,Mehmet Zahir SOLAK写道:
>>
>> Configuration and Initialization: http://old.castleproject.org/**
>> activerecord/documentation/**v1rc1/usersguide/configref.**html<http://old.castleproject.org/activerecord/documentation/v1rc1/usersguide/configref.html>
>> Xml Configuration Reference: http://old.castleproject.org/**
>> activerecord/documentation/**v1rc1/manual/xmlconfigref.html<http://old.castleproject.org/activerecord/documentation/v1rc1/manual/xmlconfigref.html>
>>
>>
>>
>> On Tue, Aug 6, 2013 at 7:11 AM, 彭典 <[email protected]> wrote:
>>
>>> How to access database shard by Castle ActiveRecord
>>> For example, shard database access or shard table access.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Castle Project Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to castle-project-users+**[email protected].
>>> To post to this group, send email to castle-pro...@**googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/**
>>> group/castle-project-users<http://groups.google.com/group/castle-project-users>
>>> .
>>> For more options, visit
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected]
> .
> Visit this group at http://groups.google.com/group/castle-project-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/groups/opt_out.