我已安装SQL Server Express。有两个表。一个是类别,另一个是库存。类别表的intSeqId列编号为1、2、3 ..,依此类推。库存表列出了项目,表intCatId中有一列。此intCatId对应于类别表的intSeqId。所有库存上都有条形码。扫描时,正确选择了库存编号,但未正确选择类别名称。而是选择类别intSeqId。如何选择相应的varCategory列而不是intSeqId列?
<td>Barcode</td>
<td>
<input class="hotaltextfield_tab_block" type="text" id="txtbarcode" ng-model="txtbarcode" style="width:90%;" autofocus />
</td>
<td style="width:11% !important">Item No.</td>
<td style="width:40% !important" class="add_image">
<select id="drpItem1" ng-model="drpItem" class="drplist" style="width:200px !important;" onchange="drpItemChange()">
<option value="-1" selected="selected">--Select Item--</option>
@{
var tblproducts = db.tblInventories.Where(m => m.varType == "Inventory").Select(m => new { m.intSeqId, m.varName }).ToList();
foreach (var item in tblproducts)
{
<option value="@item.intSeqId">@item.varName</option>
}
}
</select>
</td>
<td style="width:11% !important">Category</td>
<td style="width:40% !important" class="add_image">
<select id="drpItem1" ng-model="drpItem" class="drplist2" style="width:150px !important;" onchange="drpItemChange()">
<option value="-1" selected="selected">--Select Item--</option>
@{
var tblproducts2 = db.tblCategories.Where(n => n.varDescription == "NULL").Select(n => new { n.intSeqId, m.varCategory }).ToList();
foreach (var item in tblproducts2)
{
<option value="@item.intSeqId">@item.varCategory</option>
}
}
</select>
</td>