Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
AnswerRe: about to get trolled but Pin
Sean Mulkerrin14-Oct-08 4:18
Sean Mulkerrin14-Oct-08 4:18 
GeneralRe: about to get trolled but Pin
EliottA14-Oct-08 4:25
EliottA14-Oct-08 4:25 
AnswerRe: about to get trolled but Pin
Dan Neely14-Oct-08 4:47
Dan Neely14-Oct-08 4:47 
GeneralRe: about to get trolled but Pin
Guffa14-Oct-08 5:33
Guffa14-Oct-08 5:33 
AnswerRe: about to get trolled but Pin
Humble Programmer14-Oct-08 11:10
Humble Programmer14-Oct-08 11:10 
GeneralRe: about to get trolled but Pin
EliottA15-Oct-08 2:29
EliottA15-Oct-08 2:29 
Questionread xml Pin
arkiboys14-Oct-08 3:18
arkiboys14-Oct-08 3:18 
AnswerRe: read xml Pin
Giorgi Dalakishvili14-Oct-08 3:26
mentorGiorgi Dalakishvili14-Oct-08 3:26 
AnswerRe: read xml Pin
bcozican14-Oct-08 3:30
bcozican14-Oct-08 3:30 
GeneralRe: read xml [modified] Pin
arkiboys14-Oct-08 4:08
arkiboys14-Oct-08 4:08 
GeneralRe: read xml Pin
PIEBALDconsult14-Oct-08 4:10
mvePIEBALDconsult14-Oct-08 4:10 
AnswerRe: read xml Pin
Mohammad Dayyan14-Oct-08 4:17
Mohammad Dayyan14-Oct-08 4:17 
QuestionRemote Screen Capture Pin
lal001214-Oct-08 2:25
lal001214-Oct-08 2:25 
AnswerRe: Remote Screen Capture Pin
Abhijit Jana14-Oct-08 2:39
professionalAbhijit Jana14-Oct-08 2:39 
AnswerRe: Remote Screen Capture Pin
Pieter Alec Myburgh12-Oct-09 22:23
Pieter Alec Myburgh12-Oct-09 22:23 
QuestionPrinting Problem in printdocument for somepages Pin
suleh14-Oct-08 2:12
suleh14-Oct-08 2:12 
QuestionLinking a text box to a unique ID in C# windows app. Pin
ndeza14-Oct-08 2:03
ndeza14-Oct-08 2:03 
AnswerRe: Linking a text box to a unique ID in C# windows app. Pin
SeMartens14-Oct-08 2:26
SeMartens14-Oct-08 2:26 
GeneralRe: Linking a text box to a unique ID in C# windows app. Pin
ndeza15-Oct-08 22:49
ndeza15-Oct-08 22:49 
GeneralRe: Linking a text box to a unique ID in C# windows app. Pin
SeMartens15-Oct-08 23:13
SeMartens15-Oct-08 23:13 
GeneralRe: Linking a text box to a unique ID in C# windows app. Pin
ndeza15-Oct-08 23:31
ndeza15-Oct-08 23:31 
GeneralRe: Linking a text box to a unique ID in C# windows app. Pin
SeMartens15-Oct-08 23:55
SeMartens15-Oct-08 23:55 
Alright,

now i'm getting close to the point. I thin k you have two options here:

-------------
First one:
Use a dictionary to store the textbox and the playerid. Looks somethind like this:

// create the dictionary
Dictionary<textbox,> dictBoxes = new Dictionary<textbox,>();
// than put the id in it
dictBoxes.Add(txt0, /* the player id goes here */ );


In your storing method you can then access the value:
cmd.Parameters["@PlayerTypeID"].Value = dictBoxes[txt0];


---------------
Second option is to inherit the textbox and add another property:

public class MyPlayerIDTextbox:Textbox {

  private string m_sPlayerID;

  public string PlayerID {
    get { return this.m_sPlayerID;}
    set { this.m_sPlayerID = value;}
  }
}


Than you have to set the playerid of your textbox once:
MyPlayerIDTextbox txt0 = new MyPlayerIDTextbox();
txt0.PlayerID = /* the player id goes here */


And the storing method will look like this:
cmd.Parameters["@PlayerTypeID"].Value = txt0.PlayerID;



Hope this helps you a bit.

Regards
Sebastian

P.S: I would prefer the dictionary method, it is simplier I think. Or any other suggestions?
GeneralRe: Linking a text box to a unique ID in C# windows app. Pin
ndeza16-Oct-08 23:45
ndeza16-Oct-08 23:45 
QuestionAjax not working when a site is opend inside the another site in a Iframe. [modified] Pin
MAT100314-Oct-08 2:00
MAT100314-Oct-08 2:00 
AnswerRe: Ajax not working when a site is opend inside the another site in a frame. Pin
Abhijit Jana14-Oct-08 2:41
professionalAbhijit Jana14-Oct-08 2:41 

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.