G
Guest
Hello,
I replaced the calendar control to 3 dropdownlists(day,month and year) coz
i want to display the calendar as just like DTPicker in vb.6. But i cant able
to display like that. The form ocupies more space. But i am facing another
problem.
My table structure is staff(empid integer,joindate datetime)
i am getting the date selected as
dim doj as new datetime(yr.selectedValue,mnth.selectedvalue,dy.selectedvalue)
qry="insert into staff(empid,joindate) values(@empid,@joindate)"
dim idparam as new sqlparameter("@empid",sqlDBType.integer)
dim dtparam as new sqlparameter("@joindate",sqlDBType.datetime)
idparam.value=txtID.text
dtparam.value=doj.toShotdatestring()
conn.open()
dbcommand=new sqlcommand(qry,conn)
dbcommand.parameters.add(idparam)
dbcommand.parameters.add(dtparam)
dbcommand.executenonquery()
conn.close()
'i am getting the error "input string is not in correct format. only the
problem is with date. When using calendar, executed well. I hope some cating
problem but i couldn't resolve?
thanks for the reply
I replaced the calendar control to 3 dropdownlists(day,month and year) coz
i want to display the calendar as just like DTPicker in vb.6. But i cant able
to display like that. The form ocupies more space. But i am facing another
problem.
My table structure is staff(empid integer,joindate datetime)
i am getting the date selected as
dim doj as new datetime(yr.selectedValue,mnth.selectedvalue,dy.selectedvalue)
qry="insert into staff(empid,joindate) values(@empid,@joindate)"
dim idparam as new sqlparameter("@empid",sqlDBType.integer)
dim dtparam as new sqlparameter("@joindate",sqlDBType.datetime)
idparam.value=txtID.text
dtparam.value=doj.toShotdatestring()
conn.open()
dbcommand=new sqlcommand(qry,conn)
dbcommand.parameters.add(idparam)
dbcommand.parameters.add(dtparam)
dbcommand.executenonquery()
conn.close()
'i am getting the error "input string is not in correct format. only the
problem is with date. When using calendar, executed well. I hope some cating
problem but i couldn't resolve?
thanks for the reply