0
Good morning friends,
I am doubtful about database connection in particular for use in a project that captures database information for a Datagridview, my first problem is that table information is not coming, my doubt, I can connect the database only with the connection string, or I need beyond the connection string add the database by the Configuration Wizard data base of the visual studio ?
When defining the connection string, you also define the database you want to access. For example: connectionString="Data Source=. sqlexpress;Initial Catalog=MEUBD;Integrated Security=True"
– Vinícius
hum got it, I’m using objects to access the database : public class Daoutils { public Static Dbconnection Getconexao() { string cnx = @"Server=. /Sqlexpress14;Database=Silo;User Id=sa;Password=avila1334;"; Connected Dbconnection = new Sqlconnection(cnx); connection.Open(); Connected Return;
– João Ávila
That may be my mistake ?
– João Ávila
Returns any errors? Because you are only connecting to the database, but do not execute any query.
– Vinícius
That, it returns nothing
– João Ávila