C# - show result after running "static void Main()"
Hi all,
my need is to show result after running this code:
Code:
static void Main()
{
DBConnect dbconnect = new DBConnect();
dbconnect.OpenConnectionPublic();
dbconnect.CloseConnectionPublic();
}
It runs without error, but I can't see if it really works. Please help me, I'm new to C#.
Re: C# - show result after running "static void Main()"
Code:
Console.WriteLine("Desired output here");
Re: C# - show result after running "static void Main()"
Now my code works fine in Window Forms:
Quote:
static void Main()
{
DBConnect dbconnect = new DBConnect();
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\Temp\WriteLines4.txt", true))
{
file.WriteLine(dbconnect.CountPublic());
}
dbconnect.CloseConnectionPublic();
}
It connects to database, counts rows in table, writes result into txt file and closes connection.
Now my need is to show result in silverlight (web page) instead of writing into txt file. How do I start?
Re: C# - show result after running "static void Main()"
Quote:
Originally Posted by
Efes
Now my code works fine in Window Forms:
It connects to database, counts rows in table, writes result into txt file and closes connection.
Now my need is to show result in silverlight (web page) instead of writing into txt file. How do I start?
You start by creating a SilverLight application project instead of a console project.