Insert statement in VB.net
Solved/Closed
mikeoe2003
Posts
24
Registration date
Thursday November 1, 2012
Status
Member
Last seen
March 27, 2014
-
Nov 1, 2012 at 03:06 AM
mikeoe2003 Posts 24 Registration date Thursday November 1, 2012 Status Member Last seen March 27, 2014 - Nov 1, 2012 at 04:27 AM
mikeoe2003 Posts 24 Registration date Thursday November 1, 2012 Status Member Last seen March 27, 2014 - Nov 1, 2012 at 04:27 AM
Related:
- Insert statement in VB.net
- Fenix internet on bank statement - Guide
- Insert check mark in word - Guide
- How to insert photo in word for resume - Guide
- Insert draft watermark in word on all pages - Guide
- Insert gif in excel - Guide
2 responses
mikeoe2003
Posts
24
Registration date
Thursday November 1, 2012
Status
Member
Last seen
March 27, 2014
2
Nov 1, 2012 at 04:27 AM
Nov 1, 2012 at 04:27 AM
Dear Zohaib R
I must thank you very much i am a student trying to create a database to hold records for a primarx school in my communit in Nigeria. it worked very well and i like to say a big thank you
I must thank you very much i am a student trying to create a database to hold records for a primarx school in my communit in Nigeria. it worked very well and i like to say a big thank you
Zohaib R
Posts
2368
Registration date
Sunday September 23, 2012
Status
Member
Last seen
December 13, 2018
69
Nov 1, 2012 at 04:14 AM
Nov 1, 2012 at 04:14 AM
Hi mikeoe2003,
There is a change needed in the Database Table. Database shouldn't have any column named as password as this is a reserved keyword. Also, when passing a value from a textbox to a database you should enclose the textbox name within '" & & "'. Change the column name to passwords in your database and replace the code as mentioned below.
Replace:
mySQLString = "INSERT INTO myuser (username, password) VALUES('txtid.Text','txtpw.Text')"
with:
mySQLString = "INSERT INTO myuser (username, passwords) VALUES('" & txtid.Text & "','" & txtpw.Text & "')"
Do reply with results.
There is a change needed in the Database Table. Database shouldn't have any column named as password as this is a reserved keyword. Also, when passing a value from a textbox to a database you should enclose the textbox name within '" & & "'. Change the column name to passwords in your database and replace the code as mentioned below.
Replace:
mySQLString = "INSERT INTO myuser (username, password) VALUES('txtid.Text','txtpw.Text')"
with:
mySQLString = "INSERT INTO myuser (username, passwords) VALUES('" & txtid.Text & "','" & txtpw.Text & "')"
Do reply with results.