Din kod ser OK ut (saxat från
http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx )
Kod:
using (OdbcConnection connection =
new OdbcConnection(connectionString))
{
// The insertSQL string contains a SQL statement that
// inserts a new row in the source table.
OdbcCommand command = new OdbcCommand(insertSQL, connection);
// Open the connection and execute the insert command.
try
{
connection.Open();
command.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
// The connection is automatically closed when the
// code exits the using block.
}
Men du behöver ge oss felmeddelande och din SQL-sträng om du behöver hjälp.