As I've tried tweaking my code, I've gotten the ORA-00942 error message or a general error message saying that the state of the object was not ready to handle the request. This should be simple, as I've done it before! However, this time I'm querying against a view in Oracle (FWIW).
protected void btnLoadSelectedThing_Click(object sender, EventArgs e) { string myThing = selectedThing.Text.ToString().ToUpper(); string conStrOra = "Data Source=ORA; User Id=me; Password=pwd;"; using (OracleConnection oCon = new OracleConnection(conStrOra)) { OracleCommand cmd1 = new OracleCommand("SELECT DISTINCT THING, PRIME_THING FROM SP_SUBS_ALL_THINGS_PRIME_GMP WHERE PRIME_THING = (" +"SELECT DISTINCT PRIME_THING FROM SP_SUBS_ALL_THINGS_PRIME_GMP WHERE THING = '" + myThing + "') " +"ORDER BY THING DESC"); OracleDataAdapter da1 = new OracleDataAdapter(cmd1); DataSet ds = new DataSet(); DataTable dt = ds.Tables.Add("tblOne"); da1.Fill(ds, "tblOne"); // <== Error keeps getting thrown here! if (ds.Tables[0].Rows.Count == 0) { errTxt.Text = "Sorry, but no data was found. Please try another Thing."; } else { DataView dv = ds.Tables[0].DefaultView; dv.Sort = "THING"; rptCleis.DataSource = ds.Tables[0].DefaultView.ToTable(true, "THING"); rptCleis.DataBind(); } } }
TIA for any assistance!