本文整理汇总了C#中DataManager.ElementAt方法的典型用法代码示例。如果您正苦于以下问题:C# DataManager.ElementAt方法的具体用法?C# DataManager.ElementAt怎么用?C# DataManager.ElementAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager.ElementAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button1_Click
private void button1_Click(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex == -1 || comboBox2.SelectedIndex == -1)
{
return;
}
insertListView.Columns.Clear();
deleteListView.Columns.Clear();
insertListView.Clear();
deleteListView.Clear();
updateListView.Columns.Clear();
updateListView.Clear();
var metadata = new DataManager().MetaData(this.comboBox1.SelectedItem.ToString(), this.comboBox2.SelectedItem.ToString());
var redoInsert = "INSERT INTO " + this.comboBox2.SelectedItem.ToString() + "(";
var undoInsert = "DELETE FROM " + this.comboBox2.SelectedItem.ToString() + " WHERE ";
for (int i = 0, x = 0; i < metadata.Count - x; i++)
{
if (metadata.ElementAt(i).Types == Types.VarChar)
{
var value = metadata.ElementAt(i);
metadata.RemoveAt(i);
metadata.Add(value);
i = -1;
x++;
}
}
insertListView.Columns.Add("Transaction ID");
insertListView.Columns.Add("Begin Time");
deleteListView.Columns.Add("Transaction ID");
deleteListView.Columns.Add("Begin Time");
updateListView.Columns.Add("Transaction ID");
updateListView.Columns.Add("Begin Time");
; for (var i = 0; i < metadata.Count; i++)
{
if (i == metadata.Count - 1)
{
this.deleteListView.Columns.Add(metadata[i].Name);
insertListView.Columns.Add(metadata[i].Name);
updateListView.Columns.Add(metadata[i].Name);
redoInsert += metadata[i].Name + ")";
}
else
{
this.deleteListView.Columns.Add(metadata[i].Name);
insertListView.Columns.Add(metadata[i].Name);
updateListView.Columns.Add(metadata[i].Name);
redoInsert += metadata[i].Name + ",";
}
}
this.deleteListView.Columns.Add("Redo SQL");
this.deleteListView.Columns.Add("Undo SQL");
insertListView.Columns.Add("Redo SQL");
insertListView.Columns.Add("Undo SQL");
updateListView.Columns.Add("Redo SQL");
updateListView.Columns.Add("Undo SQL");
redoInsert += " values(";
AddValues(metadata, "LOP_DELETE_ROWS", undoInsert, redoInsert, metadata);
AddValues(metadata, "LOP_INSERT_ROWS", redoInsert, undoInsert, metadata);
}