User288213138 posted
Hi Omamxp45-1,
$sql='SELECT id , fname , reg_date ,
CONCAT("Registerd ", DATEDIFF(CURDATE(), reg_date), " Days Age.")
AS RegisteredSence
FROM users;
Can you tell me what this is? sql statement? But there is no $ symbol in TSql.
If you want to display the results of a query in a table, I recommend Ado.net.
<asp:GridView ID="GridView1" runat="server"></asp:GridView>
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
string query = "";
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlDataAdapter sda = new SqlDataAdapter(query, con))
{
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
If I misunderstand your requirement, please post more details information about your requirement.
Best regards,
Sam