On Fri, 04 Jul 2008 00:53:20 -0400, Scott M. wrote:
This still doesn't tell us anything about your problem. If you don't
know how to even see your own code, how can we help you with it?
"Ken Foskey" <fo****@optushome.com.auwrote in message
news:48********@dnews.tpgi.com.au...
>>
I don't understand how to get to the code. When I select the 'game'
datasource, I want ComboSelect comes up as a field I can use to
populate the ComboBox. ComboSelect looks something like this:
String ComboSelect
{
get {
read venue using this.venuecode, get venuedesc and countrycode;
read country using countrycode returning countrydesc; return
formatted( "{0} ({1}) - {2}", this.description,
venudesc, countrydesc);
}
}
I have the actual pseudo code working to do the above, I want to add
the method to the actual game object.
datasource game is derived from an access table automatically by adding
a datasource. How do I extend 'game' to add the extra fields. I can
then use the new improved description in my combo box automatically.
Ta
Ken
Here is the code. Not sure how it will help you:
I would like to NOT create a separate class but add a column to the match
table creating calculated column then I can simply use the values in a
combobox rather than building a separate set of objects manually.
/// <summary>
/// Display class for the Match selection dialogue
/// </summary>
internal class MatchSelect
{
private int matchId;
private int country;
/// <summary>
/// Numeric Match ID
/// </summary>
public int Id
{
get { return this.matchId; }
}
/// <summary>
/// Numeric Country code
/// </summary>
public int Country
{
get { return this.country; }
}
private StringBuilder display;
internal MatchSelect(CaptureMatch form, int id, String matchDesc,
int venue, int competition )
{
String ven;
matchId = id;
cricdet2000DataSet.tblVenueRow row =
form.cricdet2000DataSet.tblVenue.FindByID(venue);
if (row == null)
{
country = 0;
ven = "Unknown";
}
else
{
country = row.Country;
ven = row.Title;
}
cricdet2000DataSet.tblCompetitionRow row2 =
form.cricdet2000DataSet.tblCompetition.FindByID(co mpetition);
String venueComp;
if (row2 == null)
{
venueComp = "Unknown comp";
}
else
{
venueComp = row2.Title;
}
display = new StringBuilder("");
display.AppendFormat("{0} ({1}) * {2}", matchDesc, ven,
venueComp);
}
/// <summary>
/// Match description as 'match (venue) - competition' for combo
box
/// </summary>
/// <returnsString match (venue) - competition</returns>
public override String ToString()
{
return display.ToString();
}
}