如果我在数据库中的表中插入manualy,它会在网格中显示结果但是如果我从网页进入。它插入数据库但不显示结果(我页面中的网格)。
我的查询是
Declare paramfkVoucherType int(11);
SELECT ID INTO paramfkVoucherType
FROM ListOfValues_AccountVoucherType
WHERE Name='Receipt Voucher';
SELECT
V.ID as VoucherID,
V.Code as VoucherNumber,
V.ToFrom As `From`,
V.Amount as Amount,
V.IsPosted as IsPosted,
V.PostedDate as PostedDate,
V.IsApproved as IsApproved,
V.ApprovalDate as ApprovalDate,
V.VoucherDate as VoucherDate,
V.IsEdited as IsEdit,
V.EditedDate as EditedDate,
VT.Name as VoucherType,
V.Description as Description,
U.UserName As CreatedBy
FROM Account_Voucher V
INNER JOIN ListOfValues_AccountVoucherType VT ON V.fkVoucherTypeID = VT.ID
INNER JOIN usermanagement_user U ON U.ID =v.fkUserID
WHERE (V.fkVoucherTypeID = paramfkVoucherType)
AND (V.Code like concat('%',spVoucherNumber,'%') OR spVoucherNumber='')
AND (Date(V.VoucherDate) BETWEEN DATE(spFromDate) AND DATE(spToDate)
OR DATE(spFromDate)='1/1/0001'
OR DATE(spToDate)='1/1/0001')
AND (U.ID =spfkEmployeeID OR spfkEmployeeID=0)
AND (V.IsDeleted=0)
AND (VT.IsDeleted=0);
我想在网格上显示它。它是凭证的搜索查询。
请帮助..
提前感谢。
答案 0 :(得分:0)
您应该有一个按钮,用于刷新网格上的所有元素。或者一旦您在页面上添加内容就会更新网格元素的按钮,一旦更新它就会自动刷新网格,以便显示元素。手动在数据库上添加元素不是一个好习惯。
答案 1 :(得分:0)
直接在mysql中运行此查询,查看是否正在获取插入的记录。如果没有,则检查插入的数据,尤其是查询中使用的字段。