Click here to Skip to main content
16,006,382 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with PrintPreviewDialog Pin
Alomgir Miah2-Aug-05 3:12
Alomgir Miah2-Aug-05 3:12 
Generalsql ce Database problem help me........ Pin
limxiuyao1-Aug-05 18:51
limxiuyao1-Aug-05 18:51 
GeneralRe: sql ce Database problem help me........ Pin
LongRange.Shooter20-Jan-06 6:32
LongRange.Shooter20-Jan-06 6:32 
QuestionHow can I.. Pin
KORCARI1-Aug-05 17:57
KORCARI1-Aug-05 17:57 
AnswerRe: How can I.. Pin
Christian Graus1-Aug-05 18:28
protectorChristian Graus1-Aug-05 18:28 
QuestionHow can I.. Pin
KORCARI1-Aug-05 17:55
KORCARI1-Aug-05 17:55 
GeneralDropDownList Pin
tatchung1-Aug-05 17:50
tatchung1-Aug-05 17:50 
GeneralRe: DropDownList Pin
Christian Graus1-Aug-05 18:33
protectorChristian Graus1-Aug-05 18:33 
tatchung wrote:
because it builds perfectly

So what ?


tatchung wrote:
DataSet dsCompany = new DataSet();
dsCompany = objComp.fGet_Company();


this is dumb - the new dataset you created will now go into the queue for garbage collection, as you replaced it righ away with the result of this call.


tatchung wrote:
ddlcomp.DataSource = dsCompany;
ddlcomp.DataTextField = "comp_code";
ddlcomp.DataValueField = "comp_desc";
ddlcomp.DataBind();
ddlcomp.Items.Insert(0,"");


None of this is in a !IsPOstback block, so it binds every time, and your selection is lost.


tatchung wrote:
Session["Comp"] = ddlcomp.SelectedItem.Value;
Session["CompName"] = ddlcomp.SelectedItem.Text;


These will always be the first item in the list, as you just did a databind and an insert.


tatchung wrote:
dsCol = objCol.GetByClient(ddlcomp.SelectedItem.Value);

Events fire after page load and before prerender. Not knowing where you did the above, I have no idea what the SelectedItem could be at this stage.

tatchung wrote:
DataSet dsCol = new DataSet();
dsCol = objCol.GetByClient(ddlcomp.SelectedItem.Value);


Waste of memory again.

tatchung wrote:
Session["dtvwSort"] = dsCol.Tables[0].DefaultView;

You're shoving a whole table into the session ? You seem to be using session state a lot, is all of this stuff needed on other pages ? AND you shove it in twice, as dstSort and dtvwSort. This is not ASP. Why do you need this information in the session ?

tatchung wrote:
so...anything wrong with this?


The lack of an !IsPOstback is probably your core problem.



Christian Graus - Microsoft MVP - C++
GeneralRe: DropDownList Pin
tatchung1-Aug-05 19:23
tatchung1-Aug-05 19:23 
GeneralRe: DropDownList Pin
Christian Graus2-Aug-05 2:07
protectorChristian Graus2-Aug-05 2:07 
GeneralRe: DropDownList Pin
tatchung2-Aug-05 15:22
tatchung2-Aug-05 15:22 
GeneralRe: DropDownList Pin
Christian Graus2-Aug-05 15:30
protectorChristian Graus2-Aug-05 15:30 
GeneralRe: DropDownList Pin
tatchung2-Aug-05 15:39
tatchung2-Aug-05 15:39 
GeneralRe: DropDownList Pin
Christian Graus2-Aug-05 16:01
protectorChristian Graus2-Aug-05 16:01 
GeneralMulti- threads problem Pin
ppp0011-Aug-05 17:50
ppp0011-Aug-05 17:50 
GeneralRe: Multi- threads problem Pin
Robert Rohde1-Aug-05 19:08
Robert Rohde1-Aug-05 19:08 
GeneralDDE in longhorn Pin
ppp0011-Aug-05 16:24
ppp0011-Aug-05 16:24 
GeneralRe: DDE in longhorn Pin
Christian Graus1-Aug-05 16:29
protectorChristian Graus1-Aug-05 16:29 
GeneralRe: DDE in longhorn Pin
ppp0011-Aug-05 17:35
ppp0011-Aug-05 17:35 
GeneralRe: DDE in longhorn Pin
Christian Graus1-Aug-05 17:37
protectorChristian Graus1-Aug-05 17:37 
GeneralRe: DDE in longhorn Pin
ProgrammerGurdev1-Aug-05 20:38
ProgrammerGurdev1-Aug-05 20:38 
GeneralRe: DDE in longhorn Pin
ppp0011-Aug-05 20:41
ppp0011-Aug-05 20:41 
GeneralRe: DDE in longhorn Pin
Dave Kreskowiak2-Aug-05 2:38
mveDave Kreskowiak2-Aug-05 2:38 
Questionproblem due to too many forms being displayed / how to display forms neatly? Pin
nidhelp1-Aug-05 15:51
nidhelp1-Aug-05 15:51 
AnswerRe: problem due to too many forms being displayed / how to display forms neatly? Pin
Christian Graus1-Aug-05 15:59
protectorChristian Graus1-Aug-05 15:59 

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.