-
October 24th, 2012, 04:38 AM
#1
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#.
-
October 24th, 2012, 05:16 AM
#2
Re: C# - show result after running "static void Main()"
Code:
Console.WriteLine("Desired output here");
-
October 24th, 2012, 06:07 AM
#3
Re: C# - show result after running "static void Main()"
Now my code works fine in Window Forms:
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?
-
October 31st, 2012, 01:30 PM
#4
Re: C# - show result after running "static void Main()"
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|