Click here to Skip to main content
15,914,016 members
Home / Discussions / C#
   

C#

 
QuestionUsing Bookmark Pin
nicemickey_mouse26-Apr-07 18:49
nicemickey_mouse26-Apr-07 18:49 
AnswerRe: Using Bookmark Pin
Christian Graus26-Apr-07 19:08
protectorChristian Graus26-Apr-07 19:08 
Questionmdi form Pin
justintimberlake26-Apr-07 18:25
justintimberlake26-Apr-07 18:25 
AnswerRe: mdi form Pin
coolestCoder26-Apr-07 18:31
coolestCoder26-Apr-07 18:31 
AnswerRe: mdi form Pin
Abdul Sami X26-Apr-07 21:14
Abdul Sami X26-Apr-07 21:14 
QuestionAllowing user to add toolbox item in Windows Control Pin
Nadia Monalisa26-Apr-07 18:17
Nadia Monalisa26-Apr-07 18:17 
QuestionError :'Proj.frmMain' does not contain a definition for 'Comm1 Pin
cole2326-Apr-07 16:12
cole2326-Apr-07 16:12 
AnswerRe: Error :'Proj.frmMain' does not contain a definition for 'Comm1 Pin
mnvkng7626-Apr-07 17:03
mnvkng7626-Apr-07 17:03 
GeneralRe: Error :'Proj.frmMain' does not contain a definition for 'Comm1 Pin
cole2326-Apr-07 17:19
cole2326-Apr-07 17:19 
GeneralRe: Error :'Proj.frmMain' does not contain a definition for 'Comm1 Pin
Christian Graus26-Apr-07 19:08
protectorChristian Graus26-Apr-07 19:08 
GeneralRe: Error :'Proj.frmMain' does not contain a definition for 'Comm1 Pin
Abdul Sami X26-Apr-07 21:23
Abdul Sami X26-Apr-07 21:23 
AnswerRe: Error :'Proj.frmMain' does not contain a definition for 'Comm1 Pin
Christian Graus26-Apr-07 19:10
protectorChristian Graus26-Apr-07 19:10 
QuestionRenaming an Interop file Pin
lost in transition 26-Apr-07 10:31
lost in transition 26-Apr-07 10:31 
AnswerRe: Renaming an Interop file Pin
Christian Graus26-Apr-07 11:50
protectorChristian Graus26-Apr-07 11:50 
GeneralRe: Renaming an Interop file Pin
lost in transition 27-Apr-07 6:27
lost in transition 27-Apr-07 6:27 
Questioncombobox in gridview Pin
Mohammed Elkholy26-Apr-07 10:11
Mohammed Elkholy26-Apr-07 10:11 
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 

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.