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,995
  • 5
  • 34
  • 52

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,199
  • 5
  • 48
  • 92
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
  • 34,219
  • 14
  • 75
  • 100
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,310
  • 1
  • 22
  • 24