Hi i'm trying to make a report with some functions on it, but i need the field value and two report parameters (date from, date to), but it always gives to me this error when i run it
I double checked and i have that function in my class, here it is
And changed the Field Value, when i run it, it doesn't work, is something wrong???
An error has ocuured while processing TextBox 'asistenciasDataTextBox':
The expression contains undefined function call Asistencias().
I double checked and i have that function in my class, here it is
public
static
string
Asistencias(
string
cedula, DateTime desde, DateTime hasta)
{
string
WDcon = ConfigurationManager.ConnectionStrings[
"WindowsFormsApplication2.Properties.Settings.DBGriauleConnectionString"
].ConnectionString;
//Llamo la conexion SQL
SqlConnection Wdcon_usuario =
new
SqlConnection(WDcon);
SqlCommand usuario =
new
SqlCommand();
SqlDataReader usuarioDR =
null
;
//Instancio la conexion SQL
usuario.Connection = Wdcon_usuario;
//Registro el Query SQL
usuario.CommandText =
"SELECT COUNT(*) AS Expr1 FROM asistencias WHERE (ID = @cedula) AND (asistio = 1) AND (fecha >= @desde) AND (fecha <= @hasta)"
;
usuario.Parameters.AddWithValue(
"@cedula"
, cedula);
usuario.Parameters.AddWithValue(
"@desde"
, desde);
usuario.Parameters.AddWithValue(
"@hasta"
, hasta);
//Abro la conexion
Wdcon_usuario.Open();
//Ejecuto la consulta
usuarioDR = usuario.ExecuteReader();
int
respuesta = 0;
while
(usuarioDR.Read())
{
respuesta = (
int
)usuarioDR[
"Expr1"
];
}
Wdcon_usuario.Close();
return
respuesta.ToString();
}
And changed the Field Value, when i run it, it doesn't work, is something wrong???
= WindowsFormsApplication2.Funciones.Asistencias(Fields.Asistencias, Parameters.DESDE.Value, Parameters.HASTA.Value)