USING PARAMETERS IN A SELECT COMMAND
Posted: Tue 19 Jan 2010 23:28
This is the first time that I use parameters in a SELECT command and I need help.
I have a datasource with the following SELECT command:
------------------------------------------------------------------------------
SelectCommand="SELECT fan_clave, fan_nombre, fan_dir
FROM cat_clubs_fans, cat_paises, cat_artistas
WHERE fan_pais = :prmPais AND fan_artista = :prmArtista AND
fan_artista = art_clave AND fan_pais = pss_clave
ORDER BY fan_nombre"
------------------------------------------------------------------------------
My web form has 2 comboboxes and the parameters' values will depend on their values; the comboboxes' values are Int32 both.
How do I set the paprameters' values?
I tried the following:
dsDataSource.SelectParameter["prmPais"] = cboCombo1.SelectedItem.Value;
dsDataSource.SelectParameter["prmArtista"] = cboCombo2.SelectedItem.Value;
but I get a message saying "Cannot implicitly convert type 'object' to 'System.Web.UI.WebControls.Parameter'".
Please advice.
With respect,
Jorge Maldonado
I have a datasource with the following SELECT command:
------------------------------------------------------------------------------
SelectCommand="SELECT fan_clave, fan_nombre, fan_dir
FROM cat_clubs_fans, cat_paises, cat_artistas
WHERE fan_pais = :prmPais AND fan_artista = :prmArtista AND
fan_artista = art_clave AND fan_pais = pss_clave
ORDER BY fan_nombre"
------------------------------------------------------------------------------
My web form has 2 comboboxes and the parameters' values will depend on their values; the comboboxes' values are Int32 both.
How do I set the paprameters' values?
I tried the following:
dsDataSource.SelectParameter["prmPais"] = cboCombo1.SelectedItem.Value;
dsDataSource.SelectParameter["prmArtista"] = cboCombo2.SelectedItem.Value;
but I get a message saying "Cannot implicitly convert type 'object' to 'System.Web.UI.WebControls.Parameter'".
Please advice.
With respect,
Jorge Maldonado