Joined: 11 Jan 2012
Online Status: Offline
Posts: 3
Topic: [MySQL] Subquery returns more than 1 row Posted: 11 Jan 2012 at 4:09am
Hi everyone,
I'm newbie in using crystal report and now I have a problem with it. I used this SQL expression
(SELECT bk_cat FROM tbl_bk GROUP BY bk_cat ORDER BY bk_cat)
but this error occurred "Error in compiling SQL Expression: Query Engine Error: 'HY000:[MySQL][ODBC 5.1 Driver][mysqld-5.5.8]Subquery returns more than 1 row'."
I just want to list all the distinct strings. I hope you understand my problem. Any suggestion would be appreciated.
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 12 Jan 2012 at 5:17pm
You can also try
SELECT DISTINCT bk_cat FROM tbl_bk ORDER BY bk_ca
Brian
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
this is default.aspx.cs code ... i have to fetch 1 single row from my database from my table...also i have taken drop down list...and when i m selecting any of the number in drop down ...it is displaying the total tabel attributes which i have selected in the code......here is the code...plse give me correct solution asap......
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
}
protected void Button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["crmConnectionString"].ConnectionString); con.Open(); string sql1 = "select MP_ID, DOB , Height , Address , Complexion , Gender from Missing_Person where (MP_ID = 3 AND First_Name='Ravi') "; SqlDataAdapter da = new SqlDataAdapter(sql1,con); DataSet ds = new DataSet(); da.Fill(ds); ReportDocument rep_doc = new ReportDocument(); rep_doc.Load(Server.MapPath("~/FirReport.rpt")); rep_doc.SetDataSource(ds.Tables[0]); CrystalReportViewer1.ReportSource = rep_doc; //Following Statements are Optional CrystalReportViewer1.DataBind(); CrystalReportViewer1.RefreshReport(); } protected void TextBox1_TextChanged(object sender, EventArgs e) {
}
}
//" i only want one 1 row attributes to b fetch from database and to b displayed'//
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum