I have this problem
private void ContruirGrelha()
{
SqlConnection conectar = new SqlConnection(Metodos.BaseDeDados);
conectar.Open();
}
In Metodos.BaseDeDados
it tells me that I:
Cannot convert from 'method group' to 'string'
public static partial class Metodos
{
public static void BaseDeDados()
{
SqlConnection conectar = new SqlConnection(@"Data Source=DESKTOP-VJ9V9CM\SQLEXPRESS;Initial Catalog=Agenda;Integrated Security=True");
conectar.Open();
...
}
}
Metodos.BaseDeDados conect the SQL server to my programa, and he had all my data, he has all the contet of my SQL data base, and i want to use his conection and data in my "private void ConstruirGrelha()" to build a datagrid. Sorry for the bad english