0

Possible Duplicate:
Where does Console.WriteLine go in ASP.NET?

I know the delete is occuring has I checked the database

code:

    try
    {
        MyCommand.Connection.Open();

        int count = MyCommand.ExecuteNonQuery();
        if (count > 0)
        {
            Console.WriteLine("Delete Success!!!");
            //lblMessage.Text = tbTourName.Text + " Deleted!";
        }
        else
        {
            Console.WriteLine("No Delete!!!");
        }
        Console.ReadLine();

    }
    catch (SqlException ex)
    {
        Console.WriteLine("Delete Failed coz.. " + ex.Message);
    }
    finally
    {
        MyCommand.Connection.Close();
    }

Does it supposed to show the message on webpage itself?

Regards Tea

Community
  • 1
  • 1
TeaDrinkingGeek
  • 1,917
  • 5
  • 31
  • 51

3 Answers3

2

In asp.net applications, Console.WriteLine goes to output window of visual studio.

For more refer: Where does Console.WriteLine go in ASP.NET?

Community
  • 1
  • 1
Harsh Baid
  • 7,109
  • 5
  • 45
  • 90
0

The Console object does not belong to the page. This would write a line in your IDE's console.

If you want to show a message on your web page then the simplest way would be:

Response.Write();
Konstantin Dinev
  • 32,797
  • 13
  • 71
  • 95
0

Console object cannot add a content to the Page. Instead, drop the asp:label control onto the form and set its Text property to the required status.

platon
  • 5,250
  • 1
  • 20
  • 24