database - Referring to int as string in mysql query -



database - Referring to int as string in mysql query -

while working mysql database did queries made me astonished ! allow suppose little table id int , name varchar , when made update query based on id (using c#):

mysqlcommand comm = new mysqlcommand("update database.table set name=@name id=@id", sqlconn); comm.parameters.addwithvalue("@name", textbox1.text); comm.parameters.addwithvalue("@id", textbox2.text); comm.executenonquery(); sqlconn.close();

and did work correct, isn't matter if id passed database int or string, going on please explain me ?

mysql "do mean" sort of database , automatically convert types required.

most of time thing, means don't have fuss casting, can lead ambiguity , odd errors when things without knowing, truncating info silently.

mysql database

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

ruby on rails - Devise Logout Error in RoR -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -