[Solved] Insert value locating particular column in Microsoft SQL server


Always use parameterized query anyway correct your current attempt as below

"INSERT INTO tbl_user (UserID, UserName,  UserName , UserType) 
 VALUES('" + myUser.ID + "','" + myUser.Name + "', '" + myUser.Password + "', '" + myUser.Type + "')";

RECOMMENDED Way is to Go with parameterized query always to prevent SQL Injection Attacks

SqlCommand cmd = new SqlCommand("INSERT INTO tbl_user (UserID, UserName,  UserName , UserType) 
                                 VALUES (@UserID,...)", connections)
cmd.Parameters.AddWithValue("@UserID", myUser.ID)
...

0

solved Insert value locating particular column in Microsoft SQL server