var sqlCmd_KSLP = SqlClient.CreateCommand("SELECT KSLP, NSLP FROM SLP ORDER BY KSLP ASC");
using (var reader = sqlCmd_KSLP.ExecReader())
{
string my_queryString_insert = "insert into org_iogjt_import_org_gate_job_title (iogjt_jobtitle_id, iogjt_jobtitle_name, iogds_datasource_id) VALUES (?, ?, 1)";
OdbcCommand my_command_insert = new OdbcCommand(my_queryString_insert);
my_command_insert.Parameters.Add("@KSLP", OdbcType.Int);
my_command_insert.Parameters.Add("@NSLP", OdbcType.VarChar, 255);
my_command_insert.Connection = my_connection;
while (reader.Read())
{
var row = reader.GetObject(new { KSLP = 0, NSLP = "" });
if (row.KSLP != 0)
{
my_command_insert.Parameters["@KSLP"].Value = row.KSLP.ToString();
my_command_insert.Parameters["@NSLP"].Value = row.NSLP.ToString();
my_command_insert.ExecuteNonQuery();
}
}
}
INSERT INTO org_iogjt_import_org_gate_job_title (iogjt_jobtitle_id, iogjt_jobtitle_name, iogds_datasource_id) VALUES(@p1@p2,@p3)
,(@p4@p5,@p6)
,(@p7@p8,@p9), ...
my_command_insert.Parameters.Add("@p"+i, SqlDbType.Int).Value = IncidentId;