problem with DateTimePicker Control.
-
Hi, iam in windows application. i have DateTime Picker Control...i hvae to select the value from that control,pass the value thru parameters. string kc=datetimepicker1.value.ToShortDateString(); param = new FbParameter("@kc", FbDbType.Date); param.Value = kc; cmd.Parameters.Add(param); it's giving error "Conversion error form string "2008-04-22" like that. please post reply.
murali krishna
-
Hi, iam in windows application. i have DateTime Picker Control...i hvae to select the value from that control,pass the value thru parameters. string kc=datetimepicker1.value.ToShortDateString(); param = new FbParameter("@kc", FbDbType.Date); param.Value = kc; cmd.Parameters.Add(param); it's giving error "Conversion error form string "2008-04-22" like that. please post reply.
murali krishna
Try not converting the date to a string. Add it as a DateTime value to param.
param = new FbParameter("@kc", FbDbType.Date);
param.Value = datetimepicker1.Value;
cmd.Parameters.Add(param);