las lineas de codigo de a continuación mandan a llamar la fecha de una tabla en mi base de dato, el tipo de dato es DATE... al mandarla a llamar le sumo un año y la muestro en un conbobox. mi problema es que la mostrarlo en un conbobox lo muestra con hora. ejemplo: "12/11/1997 12:00:00 a.m" y solo me interesa la fecha ya que la almacenare en otra tabla.
el codigo es el siguiente:
string fecha = null; String ONFSeguro = "select DATEADD(year,1, InitVigencia) as fecha1 from DATOSSEGURO where Poliza= "+TBPoliza.Text; SqlCommand OpFeSeguro = new SqlCommand(); OpFeSeguro.Connection = MenuInicio.conexion; OpFeSeguro.CommandType = CommandType.Text; OpFeSeguro.CommandText = ONFSeguro; //Se lee el comando a ejecurar y el resultado se almacena temporalmente en un label llamado numero //Se ejecuta el comando dentro del try por si ocurre un error se atrapa y se muestre atravez del catch try { Leer = OpFeSeguro.ExecuteReader(); Leer.Read(); fecha = Leer["fecha1"].ToString(); NIVigencia.Text = fecha; OpFeSeguro.Dispose(); OpFeSeguro = null; Leer.Close(); } catch (SqlException ex) { MessageBox.Show("ERROR: " + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); }