Hi,
When i execute my code, it shows error like this
ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.
My Code id:====
public DataTable ExecuteDataTable(string strProcName, IDbDataParameter[] param)
{
DataTable dtReturn = null;
try
{
dtReturn = new DataTable();
dbAdp = new SqlDataAdapter();
dbCmd = new SqlCommand();
dbCmd.Connection = dbCon;
dbCmd.CommandType = CommandType.StoredProcedure;
dbCmd.CommandText = strProcName;
if (param != null && param.Length > 0)
{
dbCmd.Parameters.AddRange(param);
}
dbAdp.SelectCommand = dbCmd;
dbAdp.Fill(dtReturn);
return dtReturn;
}
catch (Exception ex)
{
throw ex;
}
finally
{
dbCon.Close();
}
}
Thanks in Advance
Sucharitha Goud
Bank Of America..