我有如下表:
Status userID SysID SysCode
1 1 1 A
0 1 1 B
0 1 1 C
1 1 2 A
1 1 2 B
0 1 2 C
我有10个系统,每组系统3都有系统代码。我能够填充表中的系统但无法插入系统代码,我们可以对系统代码进行硬编码,因为这些是标准的。所有控件都是动态加载的控件。
我在做:
// to get SystemID
if (readerLocalSystem.HasRows)
{
while (readerLocalSystem.Read())
{
UserAccessSystemID = Convert.ToInt32(readerLocalSystem["LocalSystemID"]);
MessageBox.Show(i.ToString());
}
}
//to insert into table
if (cb.Checked == true)
{
localSystemBranchStatus = 1;
}
else
{
localSystemBranchStatus = 0;
}
string strLocalSysBranch = "insert into LocalSystemBranch (BranchStatus, UserProfileId,LLocalSystemId, SystemCode) values('" + BranchStatus + "','" + UserProfileID + "','" + SystemID + "','" + BranchCode + "')";
如何插入SystemCode? p>