C#, In a Mysql connection proprety connection.Server and connection.DataSource are always equals or there is a case where are different?

StackOverflow https://stackoverflow.com/questions/22440638

Pregunta

In my program I can see these proprietes are always equals, can be different in some exceptional case?

¿Fue útil?

Solución

If you connect to a different server, the values will be different, but I bet you already knew that. Furthermore the documentation of the DataSource property mentions that the state of the connection (open or closed) can affect its value. I don't know about the Server property.

If you are looking for a way to identify "equal" connections, you may want to use the ConnectionString property. This is how Connection Pooling determines whether a closed connection can be reused.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top