Click here to Skip to main content
15,887,342 members
Home / Discussions / C#
   

C#

 
GeneralRe: run application c# Pin
Pete O'Hanlon24-Oct-14 4:04
mvePete O'Hanlon24-Oct-14 4:04 
AnswerRe: run application c# Pin
V.26-Oct-14 21:33
professionalV.26-Oct-14 21:33 
GeneralRe: run application c# Pin
Ibrahim.elh26-Oct-14 21:39
Ibrahim.elh26-Oct-14 21:39 
GeneralRe: run application c# Pin
V.26-Oct-14 21:53
professionalV.26-Oct-14 21:53 
Questionproblem when launching application Pin
Ibrahim.elh23-Oct-14 21:06
Ibrahim.elh23-Oct-14 21:06 
AnswerRe: problem when launching application Pin
OriginalGriff23-Oct-14 21:36
mveOriginalGriff23-Oct-14 21:36 
GeneralRe: problem when launching application Pin
Ibrahim.elh23-Oct-14 21:45
Ibrahim.elh23-Oct-14 21:45 
AnswerRe: problem when launching application Pin
OriginalGriff23-Oct-14 21:59
mveOriginalGriff23-Oct-14 21:59 
Firstly, tell us such things when you post a question - remember that we can't see your screen, access your HDD, or read your mind! Laugh | :laugh:

So - you open a connection, but you don't do anything else with it?
either add:
C#
cmd.Connection = connection;
Or use the syntax I showed in my previous answer.
In the case of your code, I'd do this instead:
C#
private void textBox1_KeyUp(object sender, KeyEventArgs e)
{
    DataTable dt = new DataTable();
    SqlDataAdapter da = new SqlDataAdapter("SELECT informix.thisent.etb FROM informix.thisent", connection);
    da.Fill(dt);
    dataGridView1.DataSource = dt;
}
As the DataAdapter will open and close the connection for you.

BTW: Please, don;t use Visual Studio default names for controls! textBox1 doesn;t mean anything to anyone reading this code, where as searchForText makes it much more obvious what you are doing. It's not a problem when your apps are tiny, but when the number of controls starts to rise it becomes a real PITA and can cause a lot of mistakes. It's well worth getting into the habit of changing the name immediately you create the control as (compared to the five or six seconds extra it takes) it can save a heck of a lot of time later!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: problem when launching application Pin
Ibrahim.elh23-Oct-14 22:05
Ibrahim.elh23-Oct-14 22:05 
GeneralRe: problem when launching application Pin
OriginalGriff23-Oct-14 22:24
mveOriginalGriff23-Oct-14 22:24 
GeneralRe: problem when launching application Pin
Ibrahim.elh23-Oct-14 22:32
Ibrahim.elh23-Oct-14 22:32 
GeneralRe: problem when launching application Pin
OriginalGriff23-Oct-14 22:38
mveOriginalGriff23-Oct-14 22:38 
GeneralRe: problem when launching application Pin
Ibrahim.elh23-Oct-14 22:45
Ibrahim.elh23-Oct-14 22:45 
GeneralRe: problem when launching application Pin
Pete O'Hanlon23-Oct-14 22:42
mvePete O'Hanlon23-Oct-14 22:42 
GeneralRe: problem when launching application Pin
Ibrahim.elh23-Oct-14 23:01
Ibrahim.elh23-Oct-14 23:01 
GeneralRe: problem when launching application Pin
Pete O'Hanlon23-Oct-14 23:08
mvePete O'Hanlon23-Oct-14 23:08 
GeneralRe: problem when launching application Pin
Ibrahim.elh23-Oct-14 23:15
Ibrahim.elh23-Oct-14 23:15 
AnswerRe: problem when launching application Pin
eljainc24-Oct-14 10:59
eljainc24-Oct-14 10:59 
QuestionGenerate xls file Windows Service Pin
Member 841450123-Oct-14 11:05
Member 841450123-Oct-14 11:05 
AnswerRe: Generate xls file Windows Service Pin
Eddy Vluggen24-Oct-14 1:49
professionalEddy Vluggen24-Oct-14 1:49 
QuestionHow to retain the drop down (which is loaded from database) values when page posted to server in MVC (c#)..? Pin
Kranthikumar.polasa23-Oct-14 8:06
Kranthikumar.polasa23-Oct-14 8:06 
QuestionSend SMS Messages Pin
Kevin Marois23-Oct-14 4:56
professionalKevin Marois23-Oct-14 4:56 
AnswerRe: Send SMS Messages Pin
BillWoodruff23-Oct-14 6:51
professionalBillWoodruff23-Oct-14 6:51 
QuestionHow do I use this class Pin
MarkB12323-Oct-14 2:12
MarkB12323-Oct-14 2:12 
AnswerRe: How do I use this class Pin
Richard MacCutchan23-Oct-14 2:35
mveRichard MacCutchan23-Oct-14 2:35 

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.