Click here to Skip to main content
15,914,074 members
Home / Discussions / C#
   

C#

 
GeneralRe: Random Pin
Peter Vertes2-Oct-07 18:17
Peter Vertes2-Oct-07 18:17 
GeneralRe: Random Pin
TJoe2-Oct-07 20:51
TJoe2-Oct-07 20:51 
QuestionVB6 ActiveX to push data to a C# Program [modified] Pin
TimNaber2-Oct-07 13:35
TimNaber2-Oct-07 13:35 
AnswerRe: VB6 ActiveX to push data to a C# Program Pin
Parwej Ahamad2-Oct-07 17:55
professionalParwej Ahamad2-Oct-07 17:55 
Questionint? Pin
seemamltn2-Oct-07 13:08
seemamltn2-Oct-07 13:08 
AnswerRe: int? Pin
Judah Gabriel Himango2-Oct-07 13:11
sponsorJudah Gabriel Himango2-Oct-07 13:11 
AnswerRe: int? Pin
Christian Graus2-Oct-07 13:11
protectorChristian Graus2-Oct-07 13:11 
QuestionHelp: NHibernate and SysCache2 [modified] Pin
emiaj2-Oct-07 12:27
emiaj2-Oct-07 12:27 
Hi there, i want to know how to setup to nhibernate for use the SysCache2 in my AspNet 2.0 Application... this is what i have been doing, in the web.config:

<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration>
<session-factory xmlns="urn:nhibernate-configuration-2.2">
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">server=XXXX;database=XXXX;uid=XXXX;password=XXXX;Max Pool Size=100;Enlist=False</property>
<property name="cache.use_query_cache">true</property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.provider_class">NHibernate.Caches.SysCache2.SysCacheProvider,NHibernate.Caches.SysCache2</property>
<mapping assembly="Model" />
</session-factory>
</hibernate-configuration>

And in my class i do the following:

public static IList<Country> GetCountryList()
{
string sql = "from Model.Country c Order By c.Countryid";
IQuery query = Base.Session().CreateQuery(sql);
query.SetCacheable(true).SetCacheRegion("nhibernate.country.countrylist");
IDictionaryEnumerator e = HttpContext.Current.Cache.GetEnumerator();
while (e.MoveNext())
{
//The first time nothing happen here
//After that the System.Web.HttpContext.Current.Cache.Count is 2
//How can i get the cached collection??
object o = e.Current;
object k = e.Key;
object v = e.Value;
}
return query.List<Country>();
}


Any help would be appreciated.
Bye.

p.d:oops, its the c# forum, my code was in vb net, now is in the right language Smile | :)


-- modified at 18:32 Tuesday 2nd October, 2007
QuestionForce XmlSerializer.Deserilize to ignore empty XML tags Pin
eggie52-Oct-07 12:12
eggie52-Oct-07 12:12 
AnswerRe: Force XmlSerializer.Deserilize to ignore empty XML tags Pin
TJoe2-Oct-07 12:39
TJoe2-Oct-07 12:39 
GeneralRe: Force XmlSerializer.Deserilize to ignore empty XML tags [modified] Pin
eggie52-Oct-07 13:49
eggie52-Oct-07 13:49 
GeneralRe: Force XmlSerializer.Deserilize to ignore empty XML tags Pin
TJoe2-Oct-07 15:16
TJoe2-Oct-07 15:16 
GeneralRe: Force XmlSerializer.Deserilize to ignore empty XML tags Pin
eggie52-Oct-07 15:43
eggie52-Oct-07 15:43 
QuestionCounter Pin
MasterSharp2-Oct-07 11:18
MasterSharp2-Oct-07 11:18 
AnswerRe: Counter Pin
Paul Conrad2-Oct-07 11:21
professionalPaul Conrad2-Oct-07 11:21 
GeneralRe: Counter Pin
MasterSharp2-Oct-07 11:21
MasterSharp2-Oct-07 11:21 
GeneralRe: Counter Pin
MasterSharp2-Oct-07 11:23
MasterSharp2-Oct-07 11:23 
GeneralRe: Counter Pin
Paul Conrad2-Oct-07 11:26
professionalPaul Conrad2-Oct-07 11:26 
AnswerRe: Counter Pin
Christian Graus2-Oct-07 13:10
protectorChristian Graus2-Oct-07 13:10 
QuestionIcon Pin
MasterSharp2-Oct-07 11:00
MasterSharp2-Oct-07 11:00 
AnswerRe: Icon Pin
Peter Vertes2-Oct-07 11:04
Peter Vertes2-Oct-07 11:04 
Questionplease help Pin
memaia2-Oct-07 10:46
memaia2-Oct-07 10:46 
AnswerRe: please help Pin
Dan Neely2-Oct-07 10:50
Dan Neely2-Oct-07 10:50 
AnswerRe: please help Pin
Colin Angus Mackay2-Oct-07 10:50
Colin Angus Mackay2-Oct-07 10:50 
AnswerRe: please help Pin
Paul Conrad2-Oct-07 10:50
professionalPaul Conrad2-Oct-07 10:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.