我想逐个将一个数据集col值插入到另一个datset值中,但是出现了错误:赋值的左侧必须是变量,属性或索引器
i = Convert.ToInt32(dsArea.Tables[0].Rows.Count);
for (int j = 0; j <= i; j++)
{
if (dsArea.Tables[0].Columns["AreaName"].ToString() == ds.Tables[0].Columns["AreaName"].ToString())
{
dsCustReg.Tables[0].Rows[j]["AreaName"].ToString() = ds.Tables[0].Rows[j]["AreaName"].ToString();
}
}
答案 0 :(得分:1)
在将ToString()
分配给变量try
i = Convert.ToInt32(dsArea.Tables[0].Rows.Count);
for (int j = 0; j <= i; j++)
{
if (dsArea.Tables[0].Columns["AreaName"].ToString() == ds.Tables[0].Columns["AreaName"].ToString())
{
dsCustReg.Tables[0].Rows[j]["AreaName"] = ds.Tables[0].Rows[j]["AreaName"].ToString();
}
}
<div class="normal-padding">
Quicksearch: <input type="text" id="searchBox"/>
</div>
<div class="ui divider"></div>
{{#each getChildren}}
<div class="normal-padding">
<div class="ui two column grid">
<div class="column" style="width:60px;">
<div class="squaredOne">
<input type="checkbox" value="{{_id.toHexString}}" class="selectedChild" id="{{_id.toHexString}}" >
<label for="{{_id.toHexString}}"></label>
</div>
</div>
<div class="column">
<label for="{{_id.toHexString}}">{{firstname}} {{lastname}}</label>
</div>
</div>
</div>
{{/each}}
答案 1 :(得分:0)
删除.ToString()
dsCustReg.Tables[0].Rows[j]["AreaName"] = ds.Tables[0].Rows[j]["AreaName"].ToString();