Click here to Skip to main content
15,894,646 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Dave Kreskowiak6-Apr-15 4:43
mveDave Kreskowiak6-Apr-15 4:43 
GeneralRe: How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Tridip Bhattacharjee6-Apr-15 21:27
professionalTridip Bhattacharjee6-Apr-15 21:27 
SuggestionRe: How to pass folder hierarchy when creating zip file from memory stream using DotNetZip library Pin
Richard Deeming7-Apr-15 2:07
mveRichard Deeming7-Apr-15 2:07 
Questionsplit string Pin
Member 103707115-Apr-15 12:53
professionalMember 103707115-Apr-15 12:53 
AnswerRe: split string Pin
Richard Andrew x645-Apr-15 13:07
professionalRichard Andrew x645-Apr-15 13:07 
GeneralصهفاRe: split string Pin
Member 103707115-Apr-15 13:20
professionalMember 103707115-Apr-15 13:20 
GeneralRe: split string Pin
PIEBALDconsult5-Apr-15 13:23
mvePIEBALDconsult5-Apr-15 13:23 
GeneralRe: split string Pin
Member 103707115-Apr-15 13:27
professionalMember 103707115-Apr-15 13:27 
GeneralRe: split string Pin
Dr Gadgit6-Apr-15 3:39
Dr Gadgit6-Apr-15 3:39 
SuggestionRe: split string Pin
Richard Deeming7-Apr-15 2:10
mveRichard Deeming7-Apr-15 2:10 
GeneralRe: split string Pin
Dr Gadgit11-Apr-15 7:36
Dr Gadgit11-Apr-15 7:36 
QuestionHow to Install Windows OS On selected IP's In a Network Pin
Member 105963985-Apr-15 0:20
Member 105963985-Apr-15 0:20 
AnswerRe: How to Install Windows OS On selected IP's In a Network Pin
OriginalGriff5-Apr-15 1:21
mveOriginalGriff5-Apr-15 1:21 
GeneralRe: How to Install Windows OS On selected IP's In a Network Pin
Member 105963985-Apr-15 1:55
Member 105963985-Apr-15 1:55 
GeneralRe: How to Install Windows OS On selected IP's In a Network Pin
OriginalGriff5-Apr-15 2:13
mveOriginalGriff5-Apr-15 2:13 
GeneralRe: How to Install Windows OS On selected IP's In a Network Pin
Dave Kreskowiak5-Apr-15 4:16
mveDave Kreskowiak5-Apr-15 4:16 
AnswerRe: How to Install Windows OS On selected IP's In a Network Pin
Dave Kreskowiak5-Apr-15 3:58
mveDave Kreskowiak5-Apr-15 3:58 
GeneralRe: How to Install Windows OS On selected IP's In a Network Pin
OriginalGriff5-Apr-15 5:39
mveOriginalGriff5-Apr-15 5:39 
GeneralRe: How to Install Windows OS On selected IP's In a Network Pin
Dave Kreskowiak5-Apr-15 5:43
mveDave Kreskowiak5-Apr-15 5:43 
GeneralRe: How to Install Windows OS On selected IP's In a Network Pin
OriginalGriff5-Apr-15 5:57
mveOriginalGriff5-Apr-15 5:57 
QuestionHow to extract XMLElement of selectedItem of ListBox in WPF? Pin
ShanmugaKS4-Apr-15 12:18
ShanmugaKS4-Apr-15 12:18 
AnswerRe: How to extract XMLElement of selectedItem of ListBox in WPF? Pin
Richard Deeming7-Apr-15 2:18
mveRichard Deeming7-Apr-15 2:18 
QuestionSelect element from a List<> Pin
DPaul19944-Apr-15 8:38
DPaul19944-Apr-15 8:38 
AnswerRe: Select element from a List<> Pin
BillWoodruff4-Apr-15 9:30
professionalBillWoodruff4-Apr-15 9:30 
If you want to select one row each time button2 is clicked, and move through the rows in order:
C#
private List<int> coada = new List<int>(26);

private currentIdi = 0;

// in button1 EventHandler code
if(coada.Count < 27) coada.add(idintrebare);

// in button2 EventHandler code
// good idea to show a MessageBox asking user if the really want to quit the app ?
if(currentIdi == coada.Count || currentIdi == 25) Application.Exit; // reached end of questions ?

currentIdi++;  // increment access pointer

selectCoada(coada[currentIdi]);

// selectCoada: get rid of the 'for/'foreach loops
private void selectCoada(int idi)
{
    // the code you use to fill the TextBoxes now
    using (Conexiune.getConnection())
    {
        string select = "SELECT DISTINCT * FROM questions WHERE id = '" + idi + "' LIMIT 1";
        // the rest of the code ...
    }
}

Comment: I think it's always a good idea to disable Controls when their use would cause an error, or when their use is irrelevant because the app is "not ready" to handle them. You might think about disabling 'button2 until clicking on it really can do something without an error.
«To kill an error's as good a service, sometimes better than, establishing new truth or fact.» Charles Darwin in "Prospero's Precepts"

GeneralRe: Select element from a List<> Pin
DPaul19944-Apr-15 10:38
DPaul19944-Apr-15 10:38 

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.