Le Coder

Le Coder

  • NA
  • 10
  • 0

odbc problem

Jan 30 2008 5:22 PM
 dtc[0].Rows[0]["admin_first_name"] = "Amadeo";
string updstr = @"UPDATE admins SET admin_first_name=@admin_first_name " +
           "WHERE admins.id_admin=@id_admin";
              
OdbcCommand com = new OdbcCommand(updstr, odbcConn);
com.Parameters.Add("@admin_first_name", OdbcType.NText,50,"admin_first_name");
// i tried by odbcType with : Text,VarChar ,NChar
dbcParameter param= com.Parameters.Add("@id_admin",OdbcType.Int,4,"id_admin");
// and here by odbcType  with BigInt, Numeric
param.SourceVersion = DataRowVersion.Original;
               
 odbcDA.UpdateCommand = com;
odbcDA.Update(ds,"admins");

The Error is : Too Few  parameters .Expected 2

i think i dont match something at the parameters
The size of the fields must be exactly as long as the one from the Database?
i have put 50 for the Text ( admin_first_name ) in my Database
and  long integer for id_admin

Answers (1)