Home > Net > In c # to do the registration of "English" username varchar unable to convert an int, boss
In c # to do the registration of "English" username varchar unable to convert an int, boss
Time:09-19
Doing the registration of "English" username varchar cannot convert int System. The Data. SqlClient. SqlException: "in a varchar value 'asdxzc' failure when converted to Data type int," Code: SqlCommand CMD=new SqlCommand (@ "select userId from the userInfo where userId='" + Text_Name. Text +"' ", conn);//in the database to find the userName name field data in the table conn.Open(); String Flag=the Convert. ToString (CMD) ExecuteScalar ());
CodePudding user response:
Field to write the wrong ah, look at your SQL, look at what you want to check again,