hi..i have a table where in date column i have datetime datatype..i want to get only time in textbox...but i m getting both date and time by this below code..help anyone...thanks
i m using vs 2005...sql 2005
Code:Try cn = New SqlConnection("server=localhost;database=attendance1;uid=sa;password=;") cn.Open() cmd = New SqlCommand("select * from shift where shift_name='" & ComboBox1.Text & "' ", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(1) End While Catch End Try dr.Close() cn.Close()




Reply With Quote