Failing over around Database db = DatabaseFactory.CreateDatabase();
and I'm not sure why. I executed the stored proc with manual parameters declared and she worked just fine. Though, I'm not being given an error or anything to go off of, so I'm not sure whats wrong. I stick a break in the code on each line leading up to, and after the Database db = DatabaseFactory.CreateDatabase();
line and it stops there, after I tell the IDE to continue it skips that line and the function ends.
For the record, my references are solid as well. I've cannibalized this code from another project I've done, so I'm likely just missing something silly. Regardless, here's the code:
public class PullDebtor
{
public static DataTable ClientNumber(string strClientID)
{
DataSet dsDebtor = new DataSet();
dsDebtor.Tables.Add("Debtors");
DbCommand dbCommand = null;
try
{
Database db = DatabaseFactory.CreateDatabase();
string sqlCommand = "sp_PullClientID";
DbCommand dbCommand1 = db.GetSqlStringCommand(sqlCommand);
dbCommand1.CommandType = CommandType.StoredProcedure;
db.AddInParameter(dbCommand1, "@ClientID", DbType.String, strClientID);
db.ExecuteNonQuery(dbCommand1);
dsDebtor = db.ExecuteDataSet(dbCommand1);
}
catch
{
return dsDebtor.Tables[0];
}
finally
{
}
return dsDebtor.Tables[0];
}
}
}