Sketchup Galaxy
New member
- Joined
- Feb 2, 2023
- Messages
- 2
- Programming Experience
- Beginner
I´m trying to take the entire datatable with its values to postgresql but I seem to do something wrong. Code is as follows:
C#:
foreach (DataRow row in dt_IS.Rows)
{
using (NpgsqlCommand cmdCopy = new NpgsqlCommand("INSERT INTO " + Table + " VALUES(@num1));", Conn))
{
object num1 = row.Table.Rows[0][0].ToString();
cmdCopy.Parameters.AddWithValue("@num1", num1);
Conn.Open();
cmdCopy.ExecuteNonQuery();
Conn.Close();
}
}
Last edited by a moderator: