Well, when almost finishing this tutorial:
http://msdn.microsoft.com/en-us/library/ff677562.aspx
I found a problem on connecting the Add-in to the database, and so the lobInstance can´t be opened: http://i.stack.imgur.com/AFzie.png
This is the error code. (in fact the error message was being popped out when the Excel 2010 client starts, but I commented the exception in order to see the full details of the problem).
Microsoft.BusinessData.Runtime.CannotConnectException was unhandled by user code
Message=Cannot connect to the LobSystem (External System).
Source=Microsoft.Office.BusinessData
HasExplicitMessage=true
IsRetriable=false
StackTrace:
Server stack trace:
at Microsoft.Office.BusinessData.SystemSpecific.Db.DbConnectionManager.Execute(Object[] args)
at Microsoft.Office.BusinessData.Infrastructure.WindowsAuthenticator.ExecuteAfterConstrainedDelegation(Object[] args)
at Microsoft.Office.BusinessData.SystemSpecific.Db.DbConnectionManager.GetConnection()
at Microsoft.Office.BusinessData.SystemSpecific.Db.DbSystemUtility.ExecuteStatic(IMethodInstance methodInstance, ILobSystemInstance lobSystemInstance, Object[] args, IExecutionContext context)
at Microsoft.Office.BusinessData.Runtime.DataClassRuntime.ExecuteInternalWithAuthNFailureRetry(ISystemUtility systemUtility, IMethodInstance methodInstanceToExecute, IMethod methodToExecute, ILobSystemInstance lobSystemInstance, ILobSystem lobSystem, IParameterCollection nonReturnParameters, Object[] overrideArgs)
at Microsoft.Office.BusinessData.Runtime.DataClassRuntime.ExecuteInternal(IDataClass thisDataClass, ILobSystemInstance lobSystemInstance, ILobSystem lobSystem, IMethodInstance methodInstanceToExecute, IMethod methodToExecute, IParameterCollection nonReturnParameters, Object[]& overrideArgs)
at Microsoft.Office.BusinessData.Runtime.EntityRuntime.ExecuteInternal(IDataClass thisDataClass, ILobSystemInstance lobSystemInstance, ILobSystem lobSystem, IMethodInstance methodInstanceToExecute, IMethod methodToExecute, IParameterCollection nonReturnParameters, Object[]& overrideArgs, IFilterCollection filters)
at Microsoft.Office.BusinessData.Runtime.EntityRuntime.ExecuteFiltered(IEntity this, IFilterCollection filterCollection, IMethodInstance methodInstanceToExecute, ILobSystemInstance lobSystemInstance)
at Microsoft.Office.BusinessData.Runtime.EntityRuntime.<FindFiltered>b__3(IEntity e, IMethodInstance mi, IFilterCollection fc, ILobSystemInstance lsi)
at Microsoft.Office.BusinessData.Runtime.EntityInstanceEnumeratorFactory.CreateEntityInstanceEnumerator(IEntity entity, IMethodInstance methodInstance, IFilterCollection filters, ILobSystemInstance lobSystemInstance, ExecutionCallBack executionCallBack)
at Microsoft.Office.BusinessData.MetadataModel.Dynamic.Entity.FindFiltered(IFilterCollection filterCollection, String finderName, ILobSystemInstance lobSystemInstance, OperationMode operationMode)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.BusinessData.MetadataModel.IEntity.FindFiltered(IFilterCollection filterCollection, String finderName, ILobSystemInstance lobSystemInstance, OperationMode mode)
at SalesOrderAddIn.SalesDataManager.GetSalesOrderHeaderItems() in C:\Users\je-mateus\Documents\je-mateus\sp training (hands-on lab)\BCS Only\Excel\C#\SalesOrderAddIn\SalesDataManager.cs:line 123
at SalesOrderAddIn.SalesOrderRibbon.SalesOrderRibbon_Load(Object sender, RibbonUIEventArgs e) in C:\Users\je-mateus\Documents\je-mateus\sp training (hands-on lab)\BCS Only\Excel\C#\SalesOrderAddIn\SalesOrderRibbon.cs:line 38
at Microsoft.Office.Tools.Ribbon.OfficeRibbon.RaiseLoadEvent(RibbonManager manager)
at Microsoft.Office.Tools.Ribbon.RibbonManager.CreateRibbon(String ribbonId, Object context)
at Microsoft.Office.Tools.Ribbon.RibbonManager.GetRibbon(IRibbonControl control)
at Microsoft.Office.Tools.Ribbon.RibbonManager.FindRibbonComponent(IRibbonControl control)
at Microsoft.Office.Tools.Ribbon.RibbonManager.Invoke(RibbonComponentCallback callback, Object[] args)
at Microsoft.Office.Tools.Ribbon.RibbonManager.System.Reflection.IReflect.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
InnerException: System.Data.SqlClient.SqlException
Message=A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Source=.Net SqlClient Data Provider
ErrorCode=-2146232060
Class=20
LineNumber=0
Number=53
Server=""
State=0
StackTrace:
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.Office.BusinessData.SystemSpecific.Db.DbConnectionManager.Execute(Object[] args)
InnerException:
Any idea why is this happening? I already gave permissions to the users to access the external content types, opened up the ports (1433), SQL Server 2008 allows remote access as well...
Hugs, and thanks for your attention,
Jorge Mateus