I'm trying to run an SQL query for SQL Server from the Console Application, but I can't manipulate or show this data on the console.
I tried this:
static void Main(string[] args)
{
string conexao = @"Integrated Security=SSPI;Persist Security Info=False;" +
"Initial Catalog=Linhas;Data Source=HP\SQLEXPRESS";
SqlConnection cn = new SqlConnection(conexao);
SqlDataAdapter Da_fun = new SqlDataAdapter(
@"select top 1 Name as '[NAME_USER]',Adress as '[ADRESS_USER]' " +
"from TB_User order by ID_User asc", cn);
DataTable Tb_fun = new DataTable();
Da_fun.Fill(Tb_fun);
Console.WriteLine(Tb_fun);
Console.ReadKey();
}
Prints something like "System.Data.DataTable" instead of beautifully formatted multicolumn layout.