Я искал решение в течение нескольких дней, и я все еще не могу найти его. У меня проблема с получением соединения в моем компоненте Script. Мне нужно запросить мою базу данных, чтобы получить идентификатор, который будет использоваться, прежде чем я вставлю его в
public override void AcquireConnections(object Transaction)
{
connMgr = base.Connections.Connection;
conn = (SqlConnection)connMgr.AcquireConnection(null);
}
Я получаю исключение здесь.
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.SqlClient.SqlConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
Любые решения?