Click here to Skip to main content
15,900,589 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I am developing project in Visual Basic 2015 using Access Table in Back end.

When I run the following code, I encounter Message for Data type Mismatch in criteria expression, how do I override the problem:

Thanks in advance:

What I have tried:

Private Sub BtnSave_Click(sender As Object, e As EventArgs) Handles BtnSave.Click


AddEmpCmd.Parameters.AddWithValue("@CLBal", (15 - (Convert.ToInt32(TxtClAvail.Text))))
            AddEmpCmd.Parameters.AddWithValue("@FLBal", (6 - (Convert.ToInt32(TxtFlAvail.Text))))


End Sub
Posted
Comments
Richard MacCutchan 7-Jul-18 11:16am    
Check that your text boxes contain only numbers. And it is better to use Int.TryParse to convert text to numbers.
Member 13895315 7-Jul-18 12:29pm    
Thanks Richard,

But How can I use Int.TryParse

Please help
Richard MacCutchan 7-Jul-18 12:40pm    
It's in the documentation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900