Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data type mismatch
Message
From
13/03/2006 13:37:43
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01103208
Message ID:
01103875
Views:
19
Hmmmm ... maybe this is a stupid question, but if you're inserting into a VFP table, why are you using something called SqlDataSourceDash6?

Also, wouldn't it be mqty.Value = ....

Is this VB.NET or just VB?

~~Bonnie



>Well, I created the parameters visually under the Insertquery builder and I have a parameter called "mQty" and its parameter source is set to the control called textbox8, that simple. In the code the parameters are referred to as "?" as you saw from my post. I tried mqty=CInt(textbox8.text)but still got same error. :-(
>
>
>
>>How are you creating the parameters? For this particular one you need to cast it to the integer when you set the parameter.
>>
>>textbox1.text=CInt(textbox1.text) isn't going to work because the .text property expects a string. It needs to be more like
>>
>>MyParameter.Value = CInt(textbox1.text)
>>
>>
>>~~Bonnie
>>
>>>>>I've been stuck trying to figure this one out. In an ASP VB web page, I am doing an insert into a VFP table and 1 field is numeric. One insert parameter that has its parameter source bound to a textbox is to be inserted into this table whose field is the numeric one called RECID.Command is this:
>>>>>
>>>>>SqlDataSourceDash6.InsertCommand = "insert into dash6 (docid,routid,fscm,part_nbr,u_I,quantity,requisiton,jon,recid) values (?,?,?,?,?,?,?,?,?)"
>>>>>if I make the RECID field of type char, I do not get "Data type mismatch" at all
>>>>
>>>>Let's see. You're writing to a Fox table so you know the table structure, and the field in question is definitely numeric. Does the insert statement work if you hard code some values instead of the parameters? (That would check your Insert statement.)
>>>>
>>>>You're getting the parameter value from input to your web page. What exactly is the value you're sending? Can you check it before your insert occurs? Any chance something in the web page isn't working as expected and you're getting a character value assigned to your parameter?
>>>
>>>Actually, I just tried hard coding a numeric value(without quotes) and it took. So there must be something amiss with the textbox value. I have tried to code it like textbox1.text=CInt(textbox1.text). How would I actually check it before the insert?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform