Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update a vfp numeric field
Message
From
13/01/2004 17:48:19
 
 
To
13/01/2004 17:42:21
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00866525
Message ID:
00866528
Views:
21
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform