FabioRochapt Posted August 16, 2012 at 03:15 PM Report Share #472461 Posted August 16, 2012 at 03:15 PM (edited) Olá, eu tenho isto: cmd.CommandText = " Insert into cc( [id], [Number], [Name], [Acc_name], [Pin_Code], [sec_code], [Exp_date], [inac]) Values (@ID, @Number, @Name, @acc_name, @Pin_code, @Sec_code, @Exp_date, @Inac)" cmd.Parameters.Add("@ID", SqlDbType.Int).Value = identify cmd.Parameters.Add("@Number", SqlDbType.Int).Value = Int(txtNumber.Text) cmd.Parameters.Add("@Name", SqlDbType.NChar).Value = txtName.Text cmd.Parameters.Add("@acc_name", SqlDbType.NChar).Value = cbAccount.Text cmd.Parameters.Add("@pin_code", SqlDbType.Int).Value = txtPin.Text cmd.Parameters.Add("@sec_code", SqlDbType.Int).Value = txtSecCode.Text cmd.Parameters.Add("@exp_date", SqlDbType.Date).Value = DPExp.Value.Date cmd.Parameters.Add("@Inac", SqlDbType.Int).Value = CType(cbInactive.Checked, Integer) O meu problema é que só queria que ficasse guardado a data do tipo "19-05-2002" e não "19-05-2002 00:00:00" O datepicker já está definido como short. Alguma ideia? Obrigado Edited August 16, 2012 at 03:24 PM by Caça Link to comment Share on other sites More sharing options...
Caça Posted August 16, 2012 at 03:25 PM Report Share #472464 Posted August 16, 2012 at 03:25 PM Coloca o campo na BD como Date e não DateTime Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
FabioRochapt Posted August 18, 2012 at 09:13 AM Author Report Share #472724 Posted August 18, 2012 at 09:13 AM Coloca o campo na BD como Date e não DateTime Está como date. Desculpa não ter mencionado. Obrigado Link to comment Share on other sites More sharing options...
Caça Posted August 20, 2012 at 08:00 AM Report Share #472896 Posted August 20, 2012 at 08:00 AM Tens a certeza? Um campo Date não guarda horas.. Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
FabioRochapt Posted August 21, 2012 at 04:27 PM Author Report Share #473038 Posted August 21, 2012 at 04:27 PM Sim, tenho a certeza, não me consigo lembrar como resolvi. Estava-me a aparecer numa listview, mas na base de dados estava bem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now