Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a list box on my form. The settings are as follows:

 

DataSource: NumberDataSet1

DisplayMember: Table.ReqNum

ValueMember: Table.ReqNum

 

I am not binding the selected item to anything as I want to assign the selected item to a variable to use as a parameter later.

 

My problem is that when I run the app, the form comes up fine, but the listbox is blank. What am i doing wrong here. Why is the listbox empty?

 

Chester

____________________________________________

http://www.pophamcafe.com

I am starting a developers section, more tutorials than anything.

Posted

if( !this.IsPostBack )

{

Listbox1.DataBind();

//Your codes

}

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

Robby:

 

The value? It is a list of requisitions in the database. I tested the dataset and it is working correctly.

 

Arch4ngel:

 

Do I put code that in the Form Load Event?

 

 

Chester

____________________________________________

http://www.pophamcafe.com

I am starting a developers section, more tutorials than anything.

Posted

I usually put it in Page_Load if I'm in Web

or Form Load if I'm in Forms.

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

are you making sure that you're filling the dataset

 

if you're using a dataadabter to fill the dataset then place this line of code in your form load event handler

 

yourdataadabter.fill(NumberDataSet1)

Proudly a Palestinian

Microsoft ASP.NET MVP

My Blog: wessamzeidan.net

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...