Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

Where is database? (4 replies)

$
0
0
I have to use this string to connect to my database in C#.

connectionString="Server=localhost; database=Flight_log_db; Uid=root; Pwd=admin";
connection=new MySQLConnection

The problem is that this throws an error when I try to open the connection because it does not know what the database is. I used the same name as the database model because I had no choice when I forward engineered the model. But I cannot connect because I get the above error, or when I do not include the database name and I get to the
MySqlCommand cmd = new MySqlCommand(sql, connection);
MySqlDataReader reader = cmd.ExecuteReader();

lines I get the error that no database was selected;

Where is the database?

Viewing all articles
Browse latest Browse all 1447


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>