Click here to Skip to main content
15,904,153 members
Home / Discussions / C#
   

C#

 
AnswerRe: General UI Question - Anybody can have a go at this one Pin
Wendelius21-Oct-08 10:57
mentorWendelius21-Oct-08 10:57 
QuestionDifference between validating and validated events ?? Pin
chandan100121-Oct-08 1:49
chandan100121-Oct-08 1:49 
GeneralRe: Difference between validating and validated events ?? Pin
Pete O'Hanlon21-Oct-08 2:17
mvePete O'Hanlon21-Oct-08 2:17 
Questioncv or resume loader Pin
jhyn21-Oct-08 1:05
jhyn21-Oct-08 1:05 
AnswerRe: cv or resume loader Pin
Pete O'Hanlon21-Oct-08 1:11
mvePete O'Hanlon21-Oct-08 1:11 
GeneralRe: cv or resume loader Pin
jhyn21-Oct-08 15:40
jhyn21-Oct-08 15:40 
GeneralRe: cv or resume loader Pin
Guffa21-Oct-08 1:28
Guffa21-Oct-08 1:28 
QuestionCache problem Pin
dabuskol21-Oct-08 0:31
dabuskol21-Oct-08 0:31 
I have four select statement in 1 stored procedure, I will use it for 4 different dropdownlist.

SqlDataAdapter sqlda = new SqlDataAdapter("populatelist_sp", osql);
sqlda.Fill(DS);
                
<code>Cache.Add("listTables", DS, null, DateTime.Now.AddMinutes(60), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.Normal, null);</code>                
DropDownList1.DataSource = DS;
DropDownList1.DataBind();


The PROBLEM: When I used the cache object to populate another dropdownlist it gives me error "Object reference" meaning the value in the cache object is NULL. Out of 10 run I encounter 8 times.

if (DropDownList2.Items.Count == 0)
{
    DataSet localDS = new DataSet();
    localDS = (DataSet)Cache["listTables"];

    DataView dv = new DataView(localDS.Tables[1]); --- Failed on this part
    DropDownList2.DataSource = dv;
    DropDownList2.DataBind();
}


Is there any settings that I need to do to retain the value inside the cache object?

GAIN: Instead of 4 roundtrip to the database in getting the value of the dropdownlist I only used 1 connection and the rest is Caching dependent.

Regards Confused | :confused:

Dabsukol

AnswerRe: Cache problem Pin
leppie21-Oct-08 0:50
leppie21-Oct-08 0:50 
GeneralRe: Cache problem Pin
dabuskol21-Oct-08 1:22
dabuskol21-Oct-08 1:22 
GeneralRe: Cache problem Pin
leppie21-Oct-08 1:34
leppie21-Oct-08 1:34 
GeneralRe: Cache problem Pin
dabuskol21-Oct-08 1:43
dabuskol21-Oct-08 1:43 
AnswerRe: Cache problem Pin
Guffa21-Oct-08 2:06
Guffa21-Oct-08 2:06 
GeneralRe: Cache problem Pin
dabuskol22-Oct-08 1:00
dabuskol22-Oct-08 1:00 
QuestionArchitecture for Software extension Pin
madmaxime120-Oct-08 23:29
madmaxime120-Oct-08 23:29 
AnswerRe: Architecture for Software extension Pin
Pete O'Hanlon20-Oct-08 23:46
mvePete O'Hanlon20-Oct-08 23:46 
GeneralRe: Architecture for Software extension Pin
madmaxime120-Oct-08 23:55
madmaxime120-Oct-08 23:55 
GeneralRe: Architecture for Software extension Pin
Pete O'Hanlon21-Oct-08 1:09
mvePete O'Hanlon21-Oct-08 1:09 
GeneralRe: Architecture for Software extension Pin
madmaxime121-Oct-08 1:24
madmaxime121-Oct-08 1:24 
GeneralRe: Architecture for Software extension Pin
Pete O'Hanlon21-Oct-08 1:24
mvePete O'Hanlon21-Oct-08 1:24 
QuestionMulticore/multithread Pin
invader8220-Oct-08 23:25
invader8220-Oct-08 23:25 
AnswerRe: Multicore/multithread Pin
Simon P Stevens20-Oct-08 23:32
Simon P Stevens20-Oct-08 23:32 
QuestionOLE Server in C# Pin
VasDemidov20-Oct-08 23:01
VasDemidov20-Oct-08 23:01 
AnswerRe: OLE Server in C# Pin
Abdallah Gomah5-Apr-10 18:26
Abdallah Gomah5-Apr-10 18:26 
QuestionHow can I programmatically generate OnDrawItem events for a ComboBox? Pin
arnold_w20-Oct-08 22:50
arnold_w20-Oct-08 22: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.