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
Post a Comment