Jump to content

[Resolvido] Guardar Data SQL DB


FabioRochapt

Recommended Posts

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 by Caça
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.