Update your code like this
private void btnSave_Click(object sender, EventArgs e)
{
string s = dtpdue_date.Value.ToString();
string s1 = dtpcompletiondate.Value.ToString();
string connectionstr = "Data Source=TUSHAR-PC;Initial Catalog=callcenter;Persist Security Info=True;User ID=sa;Password=password@123";
string sql = "Insert into tasks(t_id,Name,Priority,status,Due_date,description,date of completion) values('"+txtT_id.Text+"','"+txtname.Text+"','"+cbopriority.Text+",'"+cboStatus.Text+"','"+ s+"','"+txtcomments.Text+"'.'"+s1+"')";
DataSet dataSet = new DataSet();
using (SqlConnection connection =
new SqlConnection(connectionstr))
{
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(
sql, connection);
adapter.Fill(dataset);
dataGridView1.DataSource = dataset;
}
}
make sure that your connection string is in proper order.