Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update a vfp numeric field
Message
De
13/01/2004 17:48:19
 
 
À
13/01/2004 17:42:21
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00866525
Message ID:
00866528
Vues:
19
Sergio,

You've put a quote around your numeric field, as if it were a character field. Remove that and it should be fine.
string strUpdateSelect  = "UPDATE policy SET wsc001 = " + nBPC +"   "+
	                "WHERE policy.controlnum ==  '"+ controlNumber +"' ";
~~Bonnie



>Hello everyone,
>
>I am trying to update a field in a vfp table buy I get the following error :
>
>Data Type mismatch
>
>
>The visual foxpro field called wsc001 is numeric(numeric,10,0) type.
>
>Here is the c# code:
>
>
>int nBPC = 4;
>string strUpdateSelect  = "UPDATE policy SET wsc001 = '" + nBPC +" '   "+
>	                "WHERE policy.controlnum ==  '"+ controlNumber +"' ";
>		
>//*-- Create a command object with the update select
>OleDbCommand  VFP7UpdateCommand = new OleDbCommandstrUpdateSelect,VFPConnection);
>// Execute the command
>VFP7UpdateCommand.ExecuteNonQuery();
>//Close the connection
>VFPConnection.Close();
>
>
>
>I think the problem is with the string strUpdateSelect.
>The update will work if I update a vfp character field, but I can not get it to work for a numeric field.
>
>Any help is appreciated.
>
>Thanks,
>Sergio
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform