andreas domevscek

andreas domevscek

  • NA
  • 21
  • 8.5k

DropDownlist Fill with cursor data from table

Sep 9 2014 2:33 PM

 I have a Oracle stored procedure spGetContinents (cur_continents out t_cursor).

now i want to store data in a drop downlist but how do i do that?

ddlContinents.DataSource =

GetData("CasCadingDropDownList.spGETCONTINENTS", "cur_continents", null);

private DataSet GetData(string spName, string crsName, OracleParameter spParameter)

{

string CS = ConfigurationManager.ConnectionStrings["ConStrNHAOrcl"].ConnectionString;

using (OracleConnection con = new OracleConnection(CS))

{

OracleCommand cmd = new OracleCommand(spName,con);

cmd.Parameters.Add(crsName, OracleType.Cursor).Direction = ParameterDirection.Output;

cmd.CommandType = CommandType.StoredProcedure;

DataSet ds = new DataSet();

OracleDataAdapter da = new OracleDataAdapter();

da.SelectCommand = cmd;

da.Fill(ds);

but it won't work. how can i do this?
 

Answers (3)