For some reason I cannot get this to work at the office. Can someone see the problem?
I have the following
DataSet ds = new DataSet();
MySqlCommand myCommand = new MySqlCommand("SELECT MoveID, MovieName FROM Movies");
MySqlConnection oMySqlConn = new MySqlConnection();
oMySqlConn.ConnectionStrin
g = "server=AD3558; user id=root; password=mypass; database=mydb; pooling=false;" ;
myCommand.CommandType = CommandType.Text;
myCommand.Connection = oMySqlConn;
try
{
myCommand.Connection.Open(
);
MySqlDataAdapter da = new MySqlDataAdapter(myCommand
);
da.Fill(ds);
}
finally
{
myCommand.Connection.Close
();
}
I then get the following error
Additional information: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
If I change the server to be . or localhost I get
Additional information: Unable to connect to any of the specified MySQL hosts
I have now written the entire application without being able to test... if I can get this to connect I should be done
Start Free Trial