I would like to run this function under mono ( my current version is 4.0.2)
public Object GetConnectionProperty(SqlConnection _conn, string prop)
{
if (_conn.State == ConnectionState.Closed &
prop == "ServerVersion")
return string.Empty;
if (prop == "ClientConnectionId")
{
Guid guid = _conn.ClientConnectionId;
return guid.ToString();
}
return _conn.GetType().GetProperty(prop).GetValue(_conn);
}
But it fails with the error :
error CS1061: Type `System.Data.SqlClient.SqlConnection' does not contain a
definition for `ClientConnectionId' and no extension method
`ClientConnectionId' of type `System.Data.SqlClient.SqlConnection' could be
found. Are you missing an assembly reference?
What is the Mono equivalent of ClientConnectionId
? Or how can I fix it?