mysql problem
-
hi am using stored procedure to submit a registration form. i have checked lot of time but get the same error can yuo plz guide me. Message = "Key cannot be null.\r\nParameter name: key"
The message can't be much clearer than that. You're trying to insert a null value into a key column. To help you further we need more info, such as the table structure, the stored procedure and how it's used.
"When did ignorance become a point of view" - Dilbert
-
hi am using stored procedure to submit a registration form. i have checked lot of time but get the same error can yuo plz guide me. Message = "Key cannot be null.\r\nParameter name: key"
mylogics wrote:
i have checked lot of time but get the same error can yuo plz guide me.
:confused: I am not getting your problem, please be clear about your question. Provide code which throws exception and what exception you are getting. we can justice with your question when you did first :)
-
mylogics wrote:
i have checked lot of time but get the same error can yuo plz guide me.
:confused: I am not getting your problem, please be clear about your question. Provide code which throws exception and what exception you are getting. we can justice with your question when you did first :)
i have a stored procedure named insertreg: DELIMITER $$DROP PROCEDURE IF EXISTS `naukri4u`.`insertreg`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `insertreg`(emailaddress varchar(50),firstname varchar(50),lastname varchar(50),username varchar(50),password varchar(50),conformpassword varchar(50),mobile varchar(50),currentloc varchar(50),prefferedjobloc varchar(50),gender varchar(50),totalexp varchar(50),industry varchar(50),function varchar(50),keyskills varchar(50),highestqual varchar(50),yearofpass varchar(50),institute varchar(50),resumetitle varchar(50),resume varchar(50)) BEGIN insert into registration(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume) values(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume); END$$DELIMITER ; i want to submit a regisration form using this stored proc.this registration table have primary key reg_id which auto increments so i have not taken it in my query.the code i have written is:
public DataSet insert(Common.com_registration objcom_reg)
{
registration reg = new registration();
try
{
DbParameter dbparama0 = DAC.Parameter("emailaddress", objcom_reg.Emailaddress, DbType.String, ParameterDirection.Input);
DbParameter dbparama1 = DAC.Parameter("firstname", objcom_reg.Firstname, DbType.String, ParameterDirection.Input);
DbParameter dbparama2 = DAC.Parameter("lastname", objcom_reg.Lastname, DbType.String, ParameterDirection.Input);
DbParameter dbparama3 = DAC.Parameter("username", objcom_reg.Username, DbType.String, ParameterDirection.Input);
DbParameter dbparama4 = DAC.Parameter("password", objcom_reg.Password, DbType.String, ParameterDirection.Input);
DbParameter dbparama5 = DAC.Parameter("conformpassword", objcom_reg.Conformpassword, DbType.String, ParameterDirection.Input);
DbParameter dbparama6 = DAC.Parameter("mobile", objcom_reg.Mobile, DbType.String, ParameterDirection.Input);
DbParameter dbparama7 = DAC.Parameter("currentloc", objcom_reg.Currentlocation, DbType.String, ParameterDirection.Input);
DbParameter dbparama8 = DAC.Parameter("prefferedjobloc", objcom_reg.Prefferedjobloc, DbType.String, Parame -
i have a stored procedure named insertreg: DELIMITER $$DROP PROCEDURE IF EXISTS `naukri4u`.`insertreg`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `insertreg`(emailaddress varchar(50),firstname varchar(50),lastname varchar(50),username varchar(50),password varchar(50),conformpassword varchar(50),mobile varchar(50),currentloc varchar(50),prefferedjobloc varchar(50),gender varchar(50),totalexp varchar(50),industry varchar(50),function varchar(50),keyskills varchar(50),highestqual varchar(50),yearofpass varchar(50),institute varchar(50),resumetitle varchar(50),resume varchar(50)) BEGIN insert into registration(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume) values(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume); END$$DELIMITER ; i want to submit a regisration form using this stored proc.this registration table have primary key reg_id which auto increments so i have not taken it in my query.the code i have written is:
public DataSet insert(Common.com_registration objcom_reg)
{
registration reg = new registration();
try
{
DbParameter dbparama0 = DAC.Parameter("emailaddress", objcom_reg.Emailaddress, DbType.String, ParameterDirection.Input);
DbParameter dbparama1 = DAC.Parameter("firstname", objcom_reg.Firstname, DbType.String, ParameterDirection.Input);
DbParameter dbparama2 = DAC.Parameter("lastname", objcom_reg.Lastname, DbType.String, ParameterDirection.Input);
DbParameter dbparama3 = DAC.Parameter("username", objcom_reg.Username, DbType.String, ParameterDirection.Input);
DbParameter dbparama4 = DAC.Parameter("password", objcom_reg.Password, DbType.String, ParameterDirection.Input);
DbParameter dbparama5 = DAC.Parameter("conformpassword", objcom_reg.Conformpassword, DbType.String, ParameterDirection.Input);
DbParameter dbparama6 = DAC.Parameter("mobile", objcom_reg.Mobile, DbType.String, ParameterDirection.Input);
DbParameter dbparama7 = DAC.Parameter("currentloc", objcom_reg.Currentlocation, DbType.String, ParameterDirection.Input);
DbParameter dbparama8 = DAC.Parameter("prefferedjobloc", objcom_reg.Prefferedjobloc, DbType.String, ParamePut a break point in the code and check each
objcom_reg.
value, see if a string value is not initialised and is therefore null.Never underestimate the power of human stupidity RAH
-
Put a break point in the code and check each
objcom_reg.
value, see if a string value is not initialised and is therefore null.Never underestimate the power of human stupidity RAH
-
i have a stored procedure named insertreg: DELIMITER $$DROP PROCEDURE IF EXISTS `naukri4u`.`insertreg`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `insertreg`(emailaddress varchar(50),firstname varchar(50),lastname varchar(50),username varchar(50),password varchar(50),conformpassword varchar(50),mobile varchar(50),currentloc varchar(50),prefferedjobloc varchar(50),gender varchar(50),totalexp varchar(50),industry varchar(50),function varchar(50),keyskills varchar(50),highestqual varchar(50),yearofpass varchar(50),institute varchar(50),resumetitle varchar(50),resume varchar(50)) BEGIN insert into registration(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume) values(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume); END$$DELIMITER ; i want to submit a regisration form using this stored proc.this registration table have primary key reg_id which auto increments so i have not taken it in my query.the code i have written is:
public DataSet insert(Common.com_registration objcom_reg)
{
registration reg = new registration();
try
{
DbParameter dbparama0 = DAC.Parameter("emailaddress", objcom_reg.Emailaddress, DbType.String, ParameterDirection.Input);
DbParameter dbparama1 = DAC.Parameter("firstname", objcom_reg.Firstname, DbType.String, ParameterDirection.Input);
DbParameter dbparama2 = DAC.Parameter("lastname", objcom_reg.Lastname, DbType.String, ParameterDirection.Input);
DbParameter dbparama3 = DAC.Parameter("username", objcom_reg.Username, DbType.String, ParameterDirection.Input);
DbParameter dbparama4 = DAC.Parameter("password", objcom_reg.Password, DbType.String, ParameterDirection.Input);
DbParameter dbparama5 = DAC.Parameter("conformpassword", objcom_reg.Conformpassword, DbType.String, ParameterDirection.Input);
DbParameter dbparama6 = DAC.Parameter("mobile", objcom_reg.Mobile, DbType.String, ParameterDirection.Input);
DbParameter dbparama7 = DAC.Parameter("currentloc", objcom_reg.Currentlocation, DbType.String, ParameterDirection.Input);
DbParameter dbparama8 = DAC.Parameter("prefferedjobloc", objcom_reg.Prefferedjobloc, DbType.String, Parameand what are dbparama2,dbparama3,dbparama4,dbparama5,dbparama6,dbparama7,dbparama8,dbparama9,dbparama10,dbparama11,dbparama12,dbparama13,dbparama14,dbparama15,dbparama16,dbparama17,dbparama18? :confused:
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
and what are dbparama2,dbparama3,dbparama4,dbparama5,dbparama6,dbparama7,dbparama8,dbparama9,dbparama10,dbparama11,dbparama12,dbparama13,dbparama14,dbparama15,dbparama16,dbparama17,dbparama18? :confused:
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
Hasn't really worked out the array thingy yet!
Never underestimate the power of human stupidity RAH
-
i have a stored procedure named insertreg: DELIMITER $$DROP PROCEDURE IF EXISTS `naukri4u`.`insertreg`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `insertreg`(emailaddress varchar(50),firstname varchar(50),lastname varchar(50),username varchar(50),password varchar(50),conformpassword varchar(50),mobile varchar(50),currentloc varchar(50),prefferedjobloc varchar(50),gender varchar(50),totalexp varchar(50),industry varchar(50),function varchar(50),keyskills varchar(50),highestqual varchar(50),yearofpass varchar(50),institute varchar(50),resumetitle varchar(50),resume varchar(50)) BEGIN insert into registration(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume) values(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume); END$$DELIMITER ; i want to submit a regisration form using this stored proc.this registration table have primary key reg_id which auto increments so i have not taken it in my query.the code i have written is:
public DataSet insert(Common.com_registration objcom_reg)
{
registration reg = new registration();
try
{
DbParameter dbparama0 = DAC.Parameter("emailaddress", objcom_reg.Emailaddress, DbType.String, ParameterDirection.Input);
DbParameter dbparama1 = DAC.Parameter("firstname", objcom_reg.Firstname, DbType.String, ParameterDirection.Input);
DbParameter dbparama2 = DAC.Parameter("lastname", objcom_reg.Lastname, DbType.String, ParameterDirection.Input);
DbParameter dbparama3 = DAC.Parameter("username", objcom_reg.Username, DbType.String, ParameterDirection.Input);
DbParameter dbparama4 = DAC.Parameter("password", objcom_reg.Password, DbType.String, ParameterDirection.Input);
DbParameter dbparama5 = DAC.Parameter("conformpassword", objcom_reg.Conformpassword, DbType.String, ParameterDirection.Input);
DbParameter dbparama6 = DAC.Parameter("mobile", objcom_reg.Mobile, DbType.String, ParameterDirection.Input);
DbParameter dbparama7 = DAC.Parameter("currentloc", objcom_reg.Currentlocation, DbType.String, ParameterDirection.Input);
DbParameter dbparama8 = DAC.Parameter("prefferedjobloc", objcom_reg.Prefferedjobloc, DbType.String, Parame<edit>You are setting dbparamcoll twice but with different parameters. The first setting is never used.</edit> Ok, it's official, I'm blind like a bat.
"When did ignorance become a point of view" - Dilbert
modified on Monday, November 29, 2010 11:18 AM
-
<edit>You are setting dbparamcoll twice but with different parameters. The first setting is never used.</edit> Ok, it's official, I'm blind like a bat.
"When did ignorance become a point of view" - Dilbert
modified on Monday, November 29, 2010 11:18 AM
actually there are two arrays with different casing, and it is the second one that isn't used. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
actually there are two arrays with different casing, and it is the second one that isn't used. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
Crap, That's a sign that I need to go home now.
"When did ignorance become a point of view" - Dilbert
-
i have a stored procedure named insertreg: DELIMITER $$DROP PROCEDURE IF EXISTS `naukri4u`.`insertreg`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `insertreg`(emailaddress varchar(50),firstname varchar(50),lastname varchar(50),username varchar(50),password varchar(50),conformpassword varchar(50),mobile varchar(50),currentloc varchar(50),prefferedjobloc varchar(50),gender varchar(50),totalexp varchar(50),industry varchar(50),function varchar(50),keyskills varchar(50),highestqual varchar(50),yearofpass varchar(50),institute varchar(50),resumetitle varchar(50),resume varchar(50)) BEGIN insert into registration(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume) values(emailaddress,firstname,lastname,username,password,conformpassword,mobile,currentloc,prefferedjobloc,gender,totalexp,industry,function,keyskills,highestqual,yearofpass,institute,resumetitle,resume); END$$DELIMITER ; i want to submit a regisration form using this stored proc.this registration table have primary key reg_id which auto increments so i have not taken it in my query.the code i have written is:
public DataSet insert(Common.com_registration objcom_reg)
{
registration reg = new registration();
try
{
DbParameter dbparama0 = DAC.Parameter("emailaddress", objcom_reg.Emailaddress, DbType.String, ParameterDirection.Input);
DbParameter dbparama1 = DAC.Parameter("firstname", objcom_reg.Firstname, DbType.String, ParameterDirection.Input);
DbParameter dbparama2 = DAC.Parameter("lastname", objcom_reg.Lastname, DbType.String, ParameterDirection.Input);
DbParameter dbparama3 = DAC.Parameter("username", objcom_reg.Username, DbType.String, ParameterDirection.Input);
DbParameter dbparama4 = DAC.Parameter("password", objcom_reg.Password, DbType.String, ParameterDirection.Input);
DbParameter dbparama5 = DAC.Parameter("conformpassword", objcom_reg.Conformpassword, DbType.String, ParameterDirection.Input);
DbParameter dbparama6 = DAC.Parameter("mobile", objcom_reg.Mobile, DbType.String, ParameterDirection.Input);
DbParameter dbparama7 = DAC.Parameter("currentloc", objcom_reg.Currentlocation, DbType.String, ParameterDirection.Input);
DbParameter dbparama8 = DAC.Parameter("prefferedjobloc", objcom_reg.Prefferedjobloc, DbType.String, Parame