Where is database?
Posted by: Scott Stewart
Date: January 20, 2015 11:36AM

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?

Scott Stewart
Learning one bit at a time.

Options: ReplyQuote


Subject
Written By
Posted
Where is database?
January 20, 2015 11:36AM
January 20, 2015 11:45AM
January 20, 2015 12:45PM
January 20, 2015 01:20PM
January 20, 2015 01:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.