Click here to Skip to main content
15,885,745 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Linking a text box to a unique ID in C# windows app. Pin
ndeza16-Oct-08 23:45
ndeza16-Oct-08 23:45 
Heya Sebastian,

Wow you were right the Dictionary works perfect, but the only thing is that I have allot of exchange rates to update and insert and it only inserts for one where as I'm trying to insert in one go. Please can you assist if you can?

Oh the second option is quite complicated as you will need to convert a string to an INT32.

But I prefer the First Option much easier and more understandable.

Regards,

Ndeza


/// create the dictionary
Dictionary<TextBox, int> dictBoxes = new Dictionary<TextBox, int>();
/// than put the id in it
dictBoxes.Add(txt0, 0);
dictBoxes.Add(txt3, 3);
dictBoxes.Add(txt5, 5);
dictBoxes.Add(txt55, 55);
dictBoxes.Add(txt6, 6);
dictBoxes.Add(txt61, 61);
dictBoxes.Add(txt76, 76);
dictBoxes.Add(txt77, 77);
dictBoxes.Add(txt81, 81);
dictBoxes.Add(txt9, 9);
//All the parameters that will be added to the database
//also all the from the app
cmd.Parameters.Add("@PlayerTypeID", SqlDbType.Int, 20);
cmd.Parameters.Add("@DateYear", SqlDbType.Int, 40);
cmd.Parameters.Add("@DateMonth", SqlDbType.Int, 4);
cmd.Parameters.Add("@FXR", SqlDbType.Float);

//Assigning the Values to the parameters
cmd.Parameters["@PlayerTypeID"].Value = txt0.Text;
cmd.Parameters["@PlayerTypeID"].Value = txt3.Text;
cmd.Parameters["@PlayerTypeID"].Value = txt5.Text;
cmd.Parameters["@DateYear"].Value = cbmYear.SelectedItem;
cmd.Parameters["@DateMonth"].Value = cmbMonth.SelectedItem;
cmd.Parameters["@FXR"].Value = txt0.Text;
cmd.Parameters["@FXR"].Value = txt3.Text;
cmd.Parameters["@FXR"].Value = txt5.Text;
cmd.Parameters["@FXR"].Value = txt6.Text;
cmd.Parameters["@FXR"].Value = txt9.Text;
cmd.Parameters["@FXR"].Value = txt55.Text;
cmd.Parameters["@FXR"].Value = txt61.Text;
cmd.Parameters["@FXR"].Value = txt76.Text;
cmd.Parameters["@FXR"].Value = txt77.Text;
cmd.Parameters["@FXR"].Value = txt81.Text;
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 
QuestionException: Child list for field Region cannot be created. Pin
AtulRane14-Oct-08 1:17
AtulRane14-Oct-08 1:17 
QuestionHow to Send key-value pair on HTTP Request in C# Pin
am 200914-Oct-08 0:31
am 200914-Oct-08 0:31 
QuestionRe: How to Send key-value pair on HTTP Request in C# Pin
Mark Salsbery14-Oct-08 4:26
Mark Salsbery14-Oct-08 4:26 
QuestionI need to compile the oracle function through asp .net Pin
froxy14-Oct-08 0:21
froxy14-Oct-08 0:21 
AnswerRe: I need to compile the oracle function through asp .net Pin
Colin Angus Mackay14-Oct-08 0:29
Colin Angus Mackay14-Oct-08 0:29 
AnswerRe: I need to compile the oracle function through asp .net Pin
Wendelius14-Oct-08 10:09
mentorWendelius14-Oct-08 10:09 
Questionproblem with OutOfMemoryException Pin
Preeti197914-Oct-08 0:20
Preeti197914-Oct-08 0:20 
AnswerRe: problem with OutOfMemoryException Pin
Colin Angus Mackay14-Oct-08 0:28
Colin Angus Mackay14-Oct-08 0:28 
GeneralRe: problem with OutOfMemoryException Pin
Preeti197919-Oct-08 22:30
Preeti197919-Oct-08 22:30 
QuestionRe: problem with OutOfMemoryException Pin
Mark Salsbery14-Oct-08 4:35
Mark Salsbery14-Oct-08 4:35 
QuestionSystem.ArgumentOutOfRangeException: Pin
kankeyan13-Oct-08 23:54
kankeyan13-Oct-08 23:54 
AnswerRe: System.ArgumentOutOfRangeException: Pin
DaveyM6914-Oct-08 0:06
professionalDaveyM6914-Oct-08 0:06 
RantRe: System.ArgumentOutOfRangeException: - How many forums are you going to post this to? Pin
Ashfield14-Oct-08 1:24
Ashfield14-Oct-08 1:24 
QuestionSQL Login Protection Pin
Matt Cavanagh13-Oct-08 23:33
Matt Cavanagh13-Oct-08 23:33 
AnswerRe: SQL Login Protection Pin
Colin Angus Mackay14-Oct-08 0:06
Colin Angus Mackay14-Oct-08 0:06 

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.