As mentioned in the comments, a stored procedure would be a better approach. However, you can still do it with inline SQL:
const string query = @"DECLARE @EmpID int;
INSERT INTO EMP (empname, empdate) VALUES (@Name, @Date);
SET @EmpID = Scope_Identity();
INSERT INTO DEP (deptname, empid) VALUES (@deptname, @EmpID);";
using (SqlConnection conn = new SqlConnection(conStr))
using (SqlCommand cmd = new SqlCommand(query, conn))
{
cmd.Parameters.AddWithValue("@Name", txtb1.Text);
cmd.Parameters.AddWithValue("@Date", txtb2.Text);
cmd.Parameters.AddWithValue("@deptname", txtb3.Text);
conn.Open();
cmd.ExecuteNonQuery();
}