Mysql.Data.MysqlClient problemer med Dataadapter
Hey..Jeg forsøger med Mysql.Data.dll at oprette forbindelse til en mysql server, serveren kører fint, har en løsning på en defekt pc, som jeg ikke lige kan komme til, og skulle lige lave en lille tilføjelse, men nu kan jeg ikke få forbindelse..
Fejlen er:
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
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: 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
Source Error:
Koden er :
{
string connString ="Data Source=mysql.xxxxx.dk;Database=xxxxx;User ID=xxxxx;Password=xxxx";
DataSet dataset = new DataSet();
using (MySqlConnection connection = new MySqlConnection(connString))
{
MySqlCommand command = connection.CreateCommand();
command.CommandText = "Select * from Products";
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.SelectCommand = command;
adapter.Fill(dataset);
}
return dataset.Tables[0];
}
Det er i adapter.Fill den brokker sig..
