Advertisement
| 12.01.2008 at 01:19PM PST, ID: 23948072 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: |
private void AddButton_Click(object sender, EventArgs e)
{
{
ApplicationsListBox.SelectedIndex = -1;
if (ApplicationsListBox.SelectedItem == null)
{
//string app = ApplicationsListBox.
efpData.InsertApplications();
//MessageBox.Show("Select a skill to add");
// ApplicationsListBox.Items.Add();
}
else
{
int found;
found = ApplicationsListBox.FindStringExact(ApplicationsListBox.SelectedItem.ToString());
if (found == 0)
{
ApplicationsListBox.Items.Add(ApplicationsListBox.SelectedItem); }
else { MessageBox.Show("Application already exists"); }
}
}
}ApplicationsListBox.FindStringExact(ApplicationsListBox.SelectedItem.ToString());
if (found == 0)
{
ApplicationsListBox.Items.Add(ApplicationsListBox.SelectedItem); }
else { MessageBox.Show("Application already exists"); }
}
}
}
EFPDATA.CS
public List<string> InsertApplications(string app)
{
List<string> insertApp = new List<string>();
Database _db;
_db = DatabaseFactory.CreateDatabase("InformixConnection");
string query = "INSERT INTO [efpapplication] (app)VALUES (@app);";
using (DbCommand appCommand = _db.GetSqlStringCommand(query))
{
appCommand.Parameters.Add(new OleDbParameter("@app",app));
appCommand.CommandType = CommandType.Text;
using (IDataReader rdr = _db.ExecuteReader(appCommand))
{
while (rdr.Read())
{
insertApp.Add(rdr["app"].ToString());
}
}
}
return insertApp;
}
|
Advertisement
There are currently no qualifying experts in Informix