Ian La Flair Ian La Flair - 1 year ago 200
C# Question

parse timespan to string c#

I got stuck on converting

, in sql server jamulai column datatype is

private void btntambah_Click(object sender, EventArgs e)
int kodejadwal = Int32.Parse(txtkode.Text);
string hari = txthari.Text;
TimeSpan jamulai = new TimeSpan (txtjam.Text);
string jamselesai = txtjam2.Text;

this.jadwalPraktekTableAdapter.Insert(hari, jamulai, jamselesai);

Answer Source
  1. Please read documentation for TimeSpan: Here
  2. And custom TimeSpan to string formatting : Here

Simply follow the documentation of TimeSpan and put in the format that you require.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download