NEWBIE - Easy question regarding display of a single record

  • Thread starter Thread starter RockNRoll
  • Start date Start date
R

RockNRoll

Greetings,

I have a table with a contract number field and a contract name field. The
contract number is the primary key.

When a particular contract is selected in a listbox, I would like a label on
my asp.net page to display the contract name.

I know how to bind a SQL query to a datagrid, but how do I display a single
field of a single record in a label?

Thank you very much,
-Dave
 
You can either set the value manually trapping the changed event (rowchanged
of the datatable would do it) but in ASP.NET, you'll need a postback to
update it or you'll need to trap some client side events.
TextBoxName.Databindings.Add("Text", dataSet , "tableName.FieldName");

Depending on how many times people may select it, the PostBack may be the
best time to trap it.

HTH,

Bill

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
Back
Top