asp.net - Implicit conversion from data type nvarchar to varbinary is not allowed. Use the CONVERT function to run this query -


i have following code button click. status bit registername nvarchar dont know problem is.

sqlconnection conn = new sqlconnection(minimartsystem.dbconnection.dbconn_local);//(configurationmanager.connectionstrings["databaseconnectionstring1"].connectionstring); sqlcommand register = new sqlcommand("insert register (firstname,lastname,username,password,emailaddress,mobileno,department,dateofregister,status,registername) values (@firstname,@lastname,@username,@password,@emailaddress,@mobileno,@department,@dateofregister,@status,@registername)", conn);  register.commandtype = commandtype.text; register.parameters.addwithvalue("@firstname", tb_firstname.text); register.parameters.addwithvalue("@lastname", tb_lastname.text); register.parameters.addwithvalue("@username", tb_loginname.text); register.parameters.addwithvalue("@password", tb_passowrd.text); register.parameters.addwithvalue("@emailaddress", tb_emailaddress.text); register.parameters.addwithvalue("@mobileno", tb_mobiletno.text); register.parameters.addwithvalue("@department", dd_department.text); register.parameters.addwithvalue("@dateofregister", datetime.now.tostring("mm/dd/yyyy")); register.parameters.addwithvalue("@status", "true"); register.parameters.addwithvalue("@registername", minimartsystem.dbconnection.username);  conn.open(); 


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -