following program compiles Successfully, but exe gives above error, kindly can someone tell what is wrong
using System;
//using System.Data;
//using System.Data.SqlClient;
public class zzz
{
public static void Main()
{
try
{
string t;
t = System.Environment.GetEnvironmentVariable("QUERY_STRING");
char[] v;
v = new char[1];
v[0] = '=';
string[] u;
u = t.Split(v);
}
catch (System.Exception e)
{
Console.WriteLine(e.ToString());
}
//string sqlsttm = "select * from " + u[1];
//SqlConnection con = new SqlConnection("Server=Kings\\SqlExpress;Data=Agrasen;Trusted_Connection=true;");
//con.Open();
//SqlCommand com = new SqlCommand(sqlsttm, con);
//SqlDataReader rdr = com.ExecuteReader();
//Console.WriteLine("Content-Type:text/html\n");
//while (rdr.Read())
//{
// for (int i = 0; i < rdr.FieldCount; i++)
// Console.Write(rdr.GetValue(i) + " ");
// Console.WriteLine("<br>");
//}
}
}