hello guys. i want to talk you about a problem that i got it..
i dont know how i could to write some parameterized query with a joker like "%".
maybe im doing it in the right way cuze usually i do it in another database environments but i dont know what is the reason for it is not working...
VS says me in the output file that sqlite doesnt
admit the % character.
usually i only add the % character beside to parameter.im adding the jocker in this way :
public DataTable ListarMedic_X_IdMedico(String P_IDMedic)
{
Consulta = "select medicos.Id_Medico as 'Codigo Del Medico' , medicos.nombre as 'Nombre Del Medico', medicos.telefono as 'Telefono', medicos.direccion as 'Direccion' , medicos.especialidad as 'Especialidad', medicos.turnos as 'Turnos Por Dia' from medicos where medicos.Id_Medico =@IdMedico%";
Comando.Connection = Conexion;
Comando.CommandText = Consulta;
DataAda.SelectCommand = Comando;
Comando.Parameters.Add("@IdMedico", DbType.String).Value = P_IDMedic;
try
{
Conexion.Open();
DataAda.Fill(Ds);
Conexion.Close();
}
catch (Exception e)
{
System.Diagnostics.Debug.Print("Se ha presentado un error. " + Environment.NewLine.ToString() + Convert.ToString(e));
Conexion.Close();
return null;
}
return Ds.Tables[0];
}
aslo i tried in this way, but aslo it's not works :
Consulta = "select medicos.Id_Medico as 'Codigo Del Medico' ,
medicos.nombre as 'Nombre Del Medico', medicos.telefono as 'Telefono',
medicos.direccion as 'Direccion' , medicos.especialidad as
'Especialidad', medicos.turnos as 'Turnos Por Dia' from medicos where
medicos.Id_Medico =@IdMedico" + "%";
i hope that somebody can help me for to resolve this issuse.
Regards