You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get in following code this error: "Unable to bind value of type DateTimeOffset.'"
using (var connection = new DuckDBConnection("DataSource=mydb.duckdb"))
{
connection.Open();
// Define the DateTime and offset you want to store
DateTime dateTimeValue = new DateTime(2025, 1, 1, 12, 30, 45);
TimeSpan offset = TimeSpan.FromHours(-5);
DateTimeOffset dateTimeOffsetValue = new DateTimeOffset(dateTimeValue, offset);
string sql = "INSERT INTO mytable VALUES (?)";
using (var command = new DuckDBCommand())
{
command.Connection = connection;
command.CommandText = "CREATE TABLE IF NOT EXISTS mytable (COLUMN_TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE)";
command.ExecuteNonQuery();
command.CommandText = sql;
DuckDBParameter parameter = new DuckDBParameter(System.Data.DbType.DateTimeOffset, dateTimeOffsetValue);
command.Parameters.Add(parameter);
command.ExecuteNonQuery();
}
connection.Close();
Are DateTimeOffset parameters supported?
Thanks
The text was updated successfully, but these errors were encountered:
I get in following code this error: "Unable to bind value of type DateTimeOffset.'"
Are DateTimeOffset parameters supported?
Thanks
The text was updated successfully, but these errors were encountered: