Tech Talk A software developer on all things tech, and then some

14Nov/120

SqlDataAdapter Will Not Always Return a Result, SSMS Will

The Issue

I ran into a strange issue with an ASP.NET site (MVC2 - 4.0 Framework) where when executing a stored proc, SqlDataAdapter.Fill(DataTable) will not return any rows some of the time, but SQL Server Management Studio will almost immediately return results. The full method calling the stored procedure is below : (Auto-generated from LLBL Pro V2.6)

public virtual bool CallRetrievalStoredProcedure(string storedProcedureToCall, SqlParameter[] parameters, DataTable tableToFill)
{
	SqlCommand command = new SqlCommand(CreateCorrectStoredProcedureName(storedProcedureToCall));
	command.Connection = (SqlConnection)base.GetActiveConnection();
	if(base.IsTransactionInProgress)
	{
		command.Transaction = (SqlTransaction)base.PhysicalTransaction;
	}
	command.CommandType = CommandType.StoredProcedure;
	command.CommandTimeout = base.CommandTimeOut;

	using(SqlDataAdapter adapter = (SqlDataAdapter)CreateNewPhysicalDataAdapter())
	{
		adapter.SelectCommand = command;

		for(int i=0;i<parameters.Length;i++)
		{
			command.Parameters.Add(parameters[i]);
		}
		adapter.Fill(tableToFill);
	}
	command.Dispose();
	return true;
}

This issue occurs on both our Development and Testing servers. The difference however is that on the development server, it will usually fail once or twice then work, but on the testing server it will return zero rows every time.

25Aug/120

Error: 0xC0048006 at [Process Name], ActiveX Script Task: Retrieving the file name for a component failed

When I was testing a SSIS package that usually runs on a server, I got the following error during a process which is supposed to copy a file to a folder on a  different server.

Error: 0xC0048006 at [Process Name], ActiveX Script Task: Retrieving the file name for a component failed with error code 0x05AA8FA4.

Confused, I found a few posts (here and here)  that helped point to a permissions issue. After Googling a little more about the issue however still trying to debug it, I came across some common issues to check for when debugging this error.

  • Check you, or the process, has proper permissions for what you are trying to do
  • Make sure the file path exists, or that a file that you are inputting exists.
  • Ensure that all the file paths in your variables/configs are correct.

There are quite a few other reasons you will get this error message besides these three reasons, but these will be the issues majority of the time. Hope this helps!

   
%d bloggers like this: