Activation Error: An object or column name is missing or empty.

Sep 16, 2009 at 10:55 PM
Edited Sep 16, 2009 at 11:04 PM

I'm getting the following exception when activating SLAM:

System.Data.SqlClient.SqlException: An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) at System.Data.Linq.DataContext.ExecuteMethodCall(Object instance, MethodInfo methodInfo, Object[] parameters) at System.Data.Linq.DataContext.ExecuteCommand(String command, Object[] parameters) at AWS.SLAM.Data.SqlDataRepository.CreateContentTable(String tableSchema, String tableName, IEnumerable`1 fields) at AWS.SLAM.Data.SqlDataServices.Insert(String typeName, Hashtable values) at AWS.SLAM.Events.ListItemCreator.Create(SPListItem listItem)

The following is my config file; and btw the Topics Repository is a document library:

 

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  <ConnectionStrings Default="SLAM">
    <add Name="SLAM" ConnectionString="Database=SLAM; Data Source=DBServer; User Id=slamuser; Password=slam123" />
  </ConnectionStrings>

  <DataMapping DataSchema="SLAM">
    <List Site="BP" Name="Topics Repository" ActivationOrder="1">
      <Fields>
        <Field Name="Title" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Topic" SPType="Lookup" AssociatedList="Topics" AssociationName="TopicsRepositoryToTopics"></Field>
      </Fields>
    </List>
    <List Site="BP" Name="Topics" ActivationOrder="1">
      <Fields>
        <Field Name="Title" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Sort Order" SPType="Choice"></Field>
      </Fields>
    </List>
  </DataMapping>
</Configuration>

Do anyone have an idea why?

Developer
Sep 16, 2009 at 10:58 PM

Add a SqlType (probably to varchar(255)) attribute to your Topics Sort Order field.

-Brian

Sep 16, 2009 at 11:06 PM

Wow! Impressive speed of reply brjenkins! Many Thanks to you! It worked!