We're developing a site that uses .NET2.0 and ASA9. While developing, everything works fine. When we move the assemblies from our development PCs to the test server, which is attached to the same ASA dbserver that I use when developing, I get the following error message when attempting to access the database:

The SelectCommand.Connection property has not been initialized before calling 'Fill'.

This application is also using SQL2005 without any problem.

Here's the code:

public static DataSet StateByCode(string sCS, string sCode, out int iRowsAffected)
{
try
{
using (DataSet dataSet = new DataSet())
{
using (AsaConnection con = new AsaConnection(sCS))//Returns a new AsaConnection object.
{
using (AsaDataAdapter adapter = new AsaDataAdapter())
{
using (AsaCommand cmd = new AsaCommand("usp_LMW_DDL_StateByCode"))
{
cmd.CommandType = CommandType.StoredProcedure;
AsaParameter parm = new AsaParameter("@code", AsaDbType.VarChar, 6);
parm.Value = sCode;
cmd.Parameters.Add(parm);

cmd.Connection = con;
adapter.SelectCommand = cmd;
}
con.Open();
iRowsAffected = adapter.Fill(dataSet);
}
}
return dataSet;
}
}
catch (Exception e)
{
m_strMessage = e.Message;
throw e;
}
}

I'm using a DSN for my Data Source, b/c I've been unable to find a good DSN-less connection string for a non-local ASA9 db. I could use some help with that, as well.