Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can anyone please correct that MySql code,

In here "FromSt" and "EndSt" are variables.

I wanna run that code in Vb.net.

MySql console command:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

select st_distance from addst WHERE st_name IN ("value1","value1");

VB.net code:

 Using FindSqlS As MySqlCommand = New MySqlCommand("SELECT st_distance FROM addst WHERE st_name = '" & FromSt & "OR" & "'st_name ='" & EndSt & "'", conn)

>Solution :

Looks like you left out a quote and added an extra one in another place. Try this and see if it fixes your issue:

Using FindSqlS As MySqlCommand = New MySqlCommand("SELECT st_distance FROM addst WHERE st_name = '" & FromSt & "'" & " OR " & "st_name ='" & EndSt & "'", conn)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading