Click here to Skip to main content
15,890,973 members
Home / Discussions / C#
   

C#

 
AnswerRe: combobox in gridview Pin
isamir26-Apr-07 11:31
isamir26-Apr-07 11:31 
AnswerRe: combobox in gridview Pin
Keshav V. Kamat26-Apr-07 18:48
Keshav V. Kamat26-Apr-07 18:48 
GeneralRe: combobox in gridview Pin
Nouman Bhatti26-Apr-07 21:11
Nouman Bhatti26-Apr-07 21:11 
Questionvisual studio 2005 Pin
salie0026-Apr-07 9:52
salie0026-Apr-07 9:52 
QuestionCan I Hard Kill a Thread? Pin
Jimmanuel26-Apr-07 9:42
Jimmanuel26-Apr-07 9:42 
AnswerRe: Can I Hard Kill a Thread? Pin
Judah Gabriel Himango26-Apr-07 12:30
sponsorJudah Gabriel Himango26-Apr-07 12:30 
GeneralRe: Can I Hard Kill a Thread? Pin
Jimmanuel26-Apr-07 13:53
Jimmanuel26-Apr-07 13:53 
QuestionConsole.WriteLine - need help Pin
Slow Learner26-Apr-07 9:20
Slow Learner26-Apr-07 9:20 
Hello,

I am trying to run this program in VS 2003. This runs fine but I can't see the results in Vs 2003. Infact I am not using any grid or any thing like that but using Console.WriteLine to print the results. I know that this program prints in the command prompt but I am trying to find an option so that I can see the results in VS 2003 (either command window or any other window). Is there any other line of code that I can use to print the results in VS 2003?

static void Main()
{
//Application.Run(new Form1());
// 1. Instantiate the connection
string Connection;
Connection = "Data Source='TestServer';Initial Catalog=Northwind;Trusted_Connection=sspi";
//Connection = "Data Source='TestServer';Initial Catalog=Northwind;User id=sa;Pwd=development";
SqlConnection conn = new SqlConnection(Connection);

SqlDataReader rdr = null;

try
{
// 2. Open the connection
conn.Open();

// 3. Pass the connection to a command object
SqlCommand cmd = new SqlCommand("select * from Customers", conn);

//
// 4. Use the connection
//

// get query results
rdr = cmd.ExecuteReader();

// print the CustomerID of each record
while (rdr.Read())
{
//Console.WriteLine(rdr[0]);
System.Console.WriteLine(rdr[0]);
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
// close the reader
if (rdr != null)
{
rdr.Close();
}

// 5. Close the connection
if (conn != null)
{
conn.Close();
}
}
}
AnswerRe: Console.WriteLine - need help Pin
netJP12L26-Apr-07 9:31
netJP12L26-Apr-07 9:31 
AnswerRe: Console.WriteLine - need help Pin
isamir26-Apr-07 11:40
isamir26-Apr-07 11:40 
AnswerRe: Console.WriteLine - need help Pin
Abdul Sami X26-Apr-07 21:28
Abdul Sami X26-Apr-07 21:28 
Questioncontrol on form Pin
netJP12L26-Apr-07 8:33
netJP12L26-Apr-07 8:33 
AnswerRe: control on form Pin
Arun.Immanuel26-Apr-07 14:28
Arun.Immanuel26-Apr-07 14:28 
QuestionMySQL Connection Pin
Gareth H26-Apr-07 7:37
Gareth H26-Apr-07 7:37 
AnswerRe: MySQL Connection Pin
Wayne Phipps26-Apr-07 8:33
Wayne Phipps26-Apr-07 8:33 
GeneralRe: MySQL Connection Pin
Wayne Phipps26-Apr-07 9:22
Wayne Phipps26-Apr-07 9:22 
GeneralRe: MySQL Connection Pin
Gareth H27-Apr-07 0:05
Gareth H27-Apr-07 0:05 
QuestionTextbox Error/Problem? Pin
Gareth H26-Apr-07 7:27
Gareth H26-Apr-07 7:27 
AnswerRe: Textbox Error/Problem? Pin
mnvkng7626-Apr-07 17:07
mnvkng7626-Apr-07 17:07 
GeneralRe: Textbox Error/Problem? Pin
Gareth H26-Apr-07 22:24
Gareth H26-Apr-07 22:24 
QuestionMysql Hash Password? Pin
Eddymvp26-Apr-07 6:55
Eddymvp26-Apr-07 6:55 
AnswerRe: Mysql Hash Password? Pin
Guffa26-Apr-07 11:14
Guffa26-Apr-07 11:14 
GeneralRe: Mysql Hash Password? Pin
Eddymvp27-Apr-07 4:58
Eddymvp27-Apr-07 4:58 
AnswerRe: Mysql Hash Password? Pin
Guffa27-Apr-07 8:35
Guffa27-Apr-07 8:35 
Questionautocomplete feature Pin
Adobe200726-Apr-07 5:35
Adobe200726-Apr-07 5: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.