1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| NpgsqlConnection conn = new NpgsqlConnection("Server=localhost;Port=5432;UserId=postgres;Password=00000;Database=postgres;");
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = conn;
conn.Open();
try
{
command.CommandText = "insert into projets (ID, Title, Path, Description, DateCreated) values('" + pro.ID + "','" + pro.Title + "','" + pro.Path + "','" + pro.Description + "','" + pro.DateCreated + "')";
int rowsaffected = command.ExecuteNonQuery();
}
catch
{
throw;
} |
Partager