ALTER PROCEDURE [Deal].[USP_LoadDealHistoryByDealId]
(@DealId int,
@chk int)
AS
IF (@chk = 1)
BEGIN
SELECT
DDT.FieldType AS field,
DDT.OldValue as old,
DDT.NewValue as new,
AU.FullName AS Name,
DDT.UpdateOn AS UpdatedOn
FROM
[Deal].[DealTransaction] as DDT
INNER JOIN
AD.Users as AU ON AU.UserId = DDT.[UpdateBy]
WHERE
DDT.dealId = @DealId
END
ELSE if(@chk = 2)
BEGIN
SELECT
'No Data' as field ,
0 as old ,
0 as new ,
AU.FullName AS Name,
DD.UpdatedOn AS UpdatedOn
FROM
AD.Users as AU
INNER JOIN
[Deal].[Deals] AS DD ON AU.UserId = DD.UploadedBy
WHERE
DD.dealId = @DealId
END
UpdatedOn
Spalt von Datentyp datetime
und es zeigt meine HTML-Tabelle wie 10-09-1992/12.00
.... Aber ich will wie 10-09-1992
nur Datum zeigen, was soll ich tun?Datum/Uhrzeit Datentyp ändern?
ist hier mein HTML-Tabelle
public string LoadDealHistory(DealHistory aDealhistory)
{
StringBuilder html = new StringBuilder();
try {
using (DealTranctionGateway dealTranctionGateway = new DealTranctionGateway())
{
DataTable dt = new DataTable();
dt = dealTranctionGateway.LoadDealHistory(aDealhistory);
string dealHistory = "";
if (dt.Rows.Count > 0)
{
html.Append("<table class='table table-bordered'>");
html.Append("<thead>");
html.Append("<tr>");
html.Append("<th>S.No</th>");
html.Append("<th>FieldType</th>");
html.Append("<th>OldValue</th>");
html.Append("<th>NewValue</th>");
html.Append("<th>Full Name</th>");
html.Append("<th>UpdateOn</th>");
html.Append("</thead>");
html.Append("</tr>");
for (int i = 0; i < dt.Rows.Count; i = i + 1)
{
int sNo = i + 1;
html.Append("<tr>");
html.Append("<td>" + sNo + "</td>");
html.Append("<td>" + dt.Rows[i]["field"] + "</td>");
html.Append("<td>" + dt.Rows[i]["old"] + "</td>");
html.Append("<td>" + dt.Rows[i]["new"] + "</td>");
html.Append("<td>" + dt.Rows[i]["Name"] + "</td>");
html.Append("<td>" + dt.Rows[i]["UpdatedOn"] + "</td>");
html.Append("</tr>");
}
html.Append("</tbody>");
html.Append("</table>");
}
}
}
catch (Exception ex)
{
}
return html.ToString();
}
}
Ändern Sie nicht die SQL, formatieren Sie die HTML-Tabelle. –
Plzz hier ist mein HTML-Tabellenformat –
Welche Technologie verwenden Sie, um Ihre Daten an HTML zu binden ??? –