Hi
I have the following Problem:
I have an Access DB.
Tablename: Formate;
TableColoumns: ID (=Numeric)
Name (=string)
I wrote a Console Application to SELECT, INSERT, UPDATE the Table.
string oleConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=.......\FormatTest.mdb";
string update = "UPDATE Formate SET Name = @text WHERE ID = 1";
OleDbConnection oleConnection = new OleDbConnection(oleConnectionString);
OleDbCommand oleCommand = new OleDbCommand(update,oleConnection);
oleCommand.Parameters.Add("@anyValueName",999);
oleCommand.Parameters.Add("@text","Test Entry");
try
{
oleConnection.Open();
oleCommand.ExecuteNonQuery();
}
catch(Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
if(oleConnection.State == ConnectionState.Open)
oleConnection.Close();
}
After that I looked into the Table and the Updatequery wrote 999 instead of
"Test Entry" in the Table.
I tried the same with the Sql Namespace and a Table in a SQL Server and the
Update was correct.
Has anybody an idea??