Click here to Skip to main content
15,889,200 members
Home / Discussions / C#
   

C#

 
AnswerRe: Best way to generate bulk pdf reports from DB. Pin
OriginalGriff24-Dec-14 3:07
mveOriginalGriff24-Dec-14 3:07 
AnswerRe: Best way to generate bulk pdf reports from DB. Pin
jschell24-Dec-14 11:14
jschell24-Dec-14 11:14 
Questionhow to set font in raw text printing in vb Pin
Member 1040541424-Dec-14 0:02
Member 1040541424-Dec-14 0:02 
AnswerRe: how to set font in raw text printing in vb Pin
OriginalGriff24-Dec-14 0:37
mveOriginalGriff24-Dec-14 0:37 
GeneralRe: how to set font in raw text printing in vb Pin
Richard MacCutchan24-Dec-14 2:13
mveRichard MacCutchan24-Dec-14 2:13 
GeneralRe: how to set font in raw text printing in vb Pin
OriginalGriff24-Dec-14 2:31
mveOriginalGriff24-Dec-14 2:31 
QuestionDisplay Data In Text Box Based On ID Pin
Member 1086943723-Dec-14 19:28
Member 1086943723-Dec-14 19:28 
AnswerRe: Display Data In Text Box Based On ID Pin
OriginalGriff23-Dec-14 21:09
mveOriginalGriff23-Dec-14 21:09 
Um.
You do realise that the loop
C#
while (dbReader.Read())
    {
    txtTitle1.Text = (dbReader["Title"].ToString());
    txtContent1.Text = (dbReader["Content"].ToString());
    txtTitle2.Text = (dbReader["Title"].ToString());
    txtContent2.Text = (dbReader["Content"].ToString());
    }
will always leave the final row's worth in the text boxes, regardless of how many you return from SQL? I'd suggest replacing the while with if

And to make it do what you want, change this:
C#
string query = "select * from JobAid";
dbCommand.CommandText = query;

To this:
C#
string query = "SELECT * FROM JobAid WHERE Id=@ID";
dbCommand.CommandText = query;
dbCommand.Parameters.AddWithValue("@ID", yourIdValueToLookFor);

Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralHow to make the Util. in c# wok Pin
Member 890232823-Dec-14 8:20
Member 890232823-Dec-14 8:20 
GeneralRe: How to make the Util. in c# wok Pin
DaveAuld23-Dec-14 8:40
professionalDaveAuld23-Dec-14 8:40 
GeneralRe: How to make the Util. in c# wok Pin
Jörgen Andersson23-Dec-14 8:40
professionalJörgen Andersson23-Dec-14 8:40 
GeneralRe: How to make the Util. in c# wok Pin
Eddy Vluggen23-Dec-14 11:49
professionalEddy Vluggen23-Dec-14 11:49 
GeneralRe: How to make the Util. in c# wok Pin
OriginalGriff23-Dec-14 21:48
mveOriginalGriff23-Dec-14 21:48 
QuestionHelp with datagridview ... Pin
turbosupramk322-Dec-14 8:42
turbosupramk322-Dec-14 8:42 
SuggestionRe: Help with datagridview ... Pin
Richard MacCutchan22-Dec-14 20:43
mveRichard MacCutchan22-Dec-14 20:43 
AnswerRe: Help with datagridview ... Pin
Mycroft Holmes22-Dec-14 21:17
professionalMycroft Holmes22-Dec-14 21:17 
AnswerRe: Help with datagridview ... Pin
turbosupramk323-Dec-14 3:23
turbosupramk323-Dec-14 3:23 
GeneralRe: Help with datagridview ... Pin
Richard MacCutchan23-Dec-14 4:50
mveRichard MacCutchan23-Dec-14 4:50 
GeneralRe: Help with datagridview ... Pin
turbosupramk323-Dec-14 5:17
turbosupramk323-Dec-14 5:17 
GeneralRe: Help with datagridview ... Pin
Richard MacCutchan23-Dec-14 5:49
mveRichard MacCutchan23-Dec-14 5:49 
GeneralRe: Help with datagridview ... Pin
turbosupramk324-Dec-14 3:02
turbosupramk324-Dec-14 3:02 
GeneralRe: Help with datagridview ... Pin
Richard MacCutchan24-Dec-14 3:35
mveRichard MacCutchan24-Dec-14 3:35 
QuestionHow to save text from TextBox2 as UTF-16 (Unicode), and not as UTF-8 - C# Pin
Member 1041097221-Dec-14 20:29
Member 1041097221-Dec-14 20:29 
QuestionRe: How to save text from TextBox2 as UTF-16 (Unicode), and not as UTF-8 - C# Pin
Richard MacCutchan21-Dec-14 22:29
mveRichard MacCutchan21-Dec-14 22:29 
AnswerRe: How to save text from TextBox2 as UTF-16 (Unicode), and not as UTF-8 - C# Pin
Member 1041097223-Dec-14 0:32
Member 1041097223-Dec-14 0:32 

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.