conn1.Open(); conn2.Open(); string sql1 = "select TOP 5 `btechstudent_details`.Regd_no,Sname,Btech,Branch FROM btechstudent_details,btechstudent_academics WHERE `btechstudent_details`.Regd_no=`btechstudent_academics`.Regd_no ORDER BY Btech DESC;"; MySqlCommand com1 = new MySqlCommand(sql1, conn1); MySqlDataAdapter da1 = new MySqlDataAdapter(com1); DataSet ds = new DataSet(); da1.Fill(ds, "Regd_no"); Show.DataSource = ds.Tables["Regd_no"]; Show.DataBind();
ERROR-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5 `btechstudent_details`.Regd_no,Sname,Btech,Branch FROM btechstudent_details,bt' at line 1
SELECT TOP 5 * FROM YourTable
SELECT * FROM YourTable LIMIT 0,5
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)