FillBy问题--索引超出数组界限
网上找了下:FillBy是将结果填充到现有的DataSet中。我用visual studio 2005怎么没看到FillBy()的方法??
网上找了个人事工资管理系统里面有考勤管理,想把那个模块用到自己的系统中可那模块中有个FillBy的
if (this.考勤年份ToolStripComboBox.Text.Length < 1 || this.月份ToolStripComboBox.Text.Length < 1 || this.部门ToolStripComboBox.Text.Length < 1)
{
return;
}
try
{
this.考勤记录TableAdapter.FillBy(this.myPersonnelDataSet.考勤记录, Convert.ToInt16(this.考勤年份ToolStripComboBox.Text),Convert.ToInt16(this.月份ToolStripComboBox.Text), this.部门ToolStripComboBox.Text);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
再转到了FillBy()的定义上如下:
public virtual MyPersonnelDataSet.考勤记录DataTable GetDataBy(System.Nullable<int> 考勤年份, System.Nullable<int> 考勤月份, string 部门) {
this.Adapter.SelectCommand = this.CommandCollection[1];
if ((考勤年份.HasValue == true)) {
this.Adapter.SelectCommand.Parameters[0].Value = ((int)(考勤年份.Value));
}
else {
this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
}
if ((考勤月份.HasValue == true)) {
this.Adapter.SelectCommand.Parameters[1].Value = ((int)(考勤月份.Value));
}
else {
this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
}
if ((部门 == null)) {
this.Adapter.SelectCommand.Parameters[2].Value = System.DBNull.Value;
}
else {
this.Adapter.SelectCommand.Parameters[2].Value = ((string)(部门));
}
MyPersonnelDataSet.考勤记录DataTable dataTable = new MyPersonnelDataSet.考勤记录DataTable();
this.Adapter.Fill(dataTable);
return dataTable;
}
FillBy()的定义--上面的是什么意思??
运行后出现索引超出数组界限问题---求高收求解 真心感谢 FillBy, 索引 人事工资
补充:.NET技术 , 其他语言