I have this code, I just want to show a value that I get from a query to my DB
in the console of C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
namespace PRUEBA
{
class Program
{
public object MessageBox { get; private set; }
static void Main(string[] args)
{
}
public void ConnectToSql()
{
SqlConnection con = new SqlConnection("Data Source=name;Integrated Security=true;");
con.Open();
SqlCommand com = new SqlCommand("SELECT ---", con);
Console.WriteLine(com);
}
}
}