我有一个DataGridView
我要实现的结果是
但是每次我使用存储过程运行代码时,它都会变成这样
有用于填充表格的代码
private void btnReturnSearch_Click_1(object sender, EventArgs e)
{
dgvCurrentBorrowed.DataSource = db.sp_ViewBorrowedEquipment(int.Parse(txtReturnID.Text));
}
这是存储过程
CREATE PROC sp_ViewBorrowedEquipment
(
@TransactionID int
)
as
SELECT TBLEQUIPMENTDETAILS.EQUIPMENT_ID as 'ID', TBLEQUIPMENTDETAILS.EQUIPMENT_NAME as 'Name', TBLBORROWED.Quantity, TBLBORROWED.IsGoodCondition as 'Returned?', TBLBORROWED.IsGoodCondition AS 'Good Condition?' FROM TBLBORROWED
INNER JOIN TBLEQUIPMENTDETAILS ON TBLBORROWED.EQUIPMENT_ID=TBLEQUIPMENTDETAILS.EQUIPMENT_ID
INNER JOIN TBLTRANSACTION ON TBLBORROWED.TransactionID=TBLTRANSACTION.TransactionID
WHERE TBLTRANSACTION.TransactionID=@TransactionID
任何评论或任何想法都将真正帮助