Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adapter.Fill exception
Message
From
04/09/2008 14:11:03
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01344857
Message ID:
01344892
Views:
13
>>Hi All,
>>
>>I am running Mere Mortals but this exception is being thrown fromt he SqlAdapter.Fill method so shouldn't matter much.
>>When adapter.Fill(ds, tableName); is called I am getting an exception of "Invalid object name dbo.CompanyAccess"
>>
>>I am not sure if this means the connection is not working or it can't find this table. The table does definately exist and I tried a different table access with the same result. What might cause this to happen?
>>Tim
>
>Would have something to do with the database name changing between your local copy and the site? Maybe some of the generated SQL refers to the other server?

hmmm.., The databases are named differently due to the naming convention on the hosted server. I don't have any mm generated DataAccess Classes though. I was calling bizObj.GetAllEntities() in this test client app so I changed it to a specific method in the business object with SPT.
oCompany.GetActiveCompanies();

and in the biz Ojb method.
return this.GetEntityList<CompanyAccessEntity>("SELECT * FROM TruckAccess WHERE IsActive = @IsActive",
     this.CreateParameter("@IsActive", true));
My thinking is this should just pass through the Select command directly. All the rest should be in the connection string. Also, I just thought about it but I am testing against my local database and my Business objects were generated against the local database also. The BLG access the data via the connection string in App.config of the business object project just fine.

I am not sure what is going on. Here is the detail from the exception.
System.Data.SqlClient.SqlException was unhandled by user code
  Message="Invalid object name 'dbo.CompanyAccess'."
  Source=".Net SqlClient Data Provider"
  ErrorCode=-2146232060
  Class=16
  LineNumber=1
  Number=208
  Procedure=""
  Server="(local)"
  State=1
  StackTrace:
       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.SqlDataReader.ConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
       at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
       at OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, IDbDataAdapter dbAdapter, String tableName, Boolean clearOnFill)
       at OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, IDbCommand command, String tableName, Boolean clearOnFill)
       at OakLeaf.MM.Main.mmWCFDataService.FillDataSet(String xmlCommand, String tableName, Boolean clearOnFill, Boolean parameterTranslation, String dataAccessClass, String databaseSetKey, String databaseKey)
       at SyncInvokeFillDataSet(Object , Object[] , Object[] )
       at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
  InnerException:
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform